Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新界面 #9

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func main() {
r.SetFuncMap(funcMap)
r.LoadHTMLGlob("templates/**/*")
r.Static("/css", "templates/css")
r.StaticFile("/favicon.ico", "templates/favicon.ico")
r.GET("/", cache.CacheByRequestURI(memoryCache, 30*time.Second), FetchPosts)
r.GET("/category/:category_id/:category_name", cache.CacheByRequestURI(memoryCache, 30*time.Second), FetchPosts)
r.GET("/post/:id/:title", cache.CacheByRequestURI(memoryCache, 1*time.Hour), FetchPost)
Expand Down
2 changes: 1 addition & 1 deletion templates/base/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="mx-auto max-w-2xl lg:max-w-5xl">
<div class="flex flex-col items-center justify-between gap-6 sm:flex-row">
<div class="flex gap-6 text-sm font-medium text-zinc-800 dark:text-zinc-200">
<a class="transition hover:text-teal-500 dark:hover:text-teal-400" href="/">Home</a>
<a class="transition hover:text-teal-500 dark:hover:text-teal-400" href="/">主页</a>
<p class="text-sm text-zinc-400 dark:text-zinc-500">©
<!-- -->2022
<!-- --> Leetao. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion templates/base/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul
class="flex rounded-full bg-white/90 px-3 text-sm font-medium text-zinc-800 shadow-lg shadow-zinc-800/5 ring-1 ring-zinc-900/5 backdrop-blur dark:bg-zinc-800/90 dark:text-zinc-200 dark:ring-white/10">
<li><a class="relative block px-3 py-2 transition hover:text-teal-500 dark:hover:text-teal-400 item-menu"
href="/">Home</a></li>
href="/">主页</a></li>
{{ range $index, $Navbar := .Navbars }}
<li><a class="relative block px-3 py-2 transition hover:text-teal-500 dark:hover:text-teal-400 item-menu"
href="/category/{{.Id}}/{{.Name}}">{{.Name}}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<div class="grow flex flex-col pl-5 pt-2">
<div class="font-bold text-sm md:text-lg lg:text-xl group-hover:underline">
<a href="/">Home</a>
<a href="/">主页</a>
</div>
<div class="font-semibold text-sm md:text-md lg:text-lg
text-gray-400 group-hover:text-gray-500
Expand Down