From 03757128df8774136f68acddcd346ffa3ee275fe Mon Sep 17 00:00:00 2001 From: Verdant Date: Sun, 22 Mar 2026 20:54:46 +0800 Subject: refactor: refactor index - add introduction - modify recent posts pieces - modify background color --- layouts/_default/baseof.html | 4 - layouts/partials/nav.html | 5 +- layouts/partials/style.html | 20 ++--- layouts/shortcodes/recent-posts.html | 160 ++++++++++------------------------- 4 files changed, 51 insertions(+), 138 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 21454e4..aad83c9 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -15,10 +15,6 @@ ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} {{- partial "style.html" . -}} - - - - diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 96bf26b..c9ace2f 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,6 +1,7 @@ +首页 {{ range .Site.Menus.main }} -{{ .Name }} +{{ .Name}} {{ end }} {{ with .Site.GetPage "/blog" }} -Blog +Blog {{ end }} diff --git a/layouts/partials/style.html b/layouts/partials/style.html index ec4dae2..0c11755 100644 --- a/layouts/partials/style.html +++ b/layouts/partials/style.html @@ -4,10 +4,10 @@ --font-secondary: monospace; --font-size-primary: 1rem; --font-size-secondary: .85rem; - --body-bg-color: #ffffff; + --body-bg-color: #fbfbf6; --bold-text-color: #222; --body-text-color: #444; - --link-color: #0066cc; + --link-color: #0355a6; --link-visited-color: #551a8b; --table-border-color: #f2f2f2; --table-th-bg-color: #f2f2f2; @@ -68,7 +68,7 @@ h1, h2 { margin-top: 1.5em; } -.post-meta-item a, .rss-icon a, .post-title a, header a, a.title h1, p { +.post-meta-item a, .rss-icon a, .post-title a, a.title h1, p { color: var(--body-text-color) } @@ -140,7 +140,6 @@ time { header { margin-top: 30px; -margin-bottom: 2rem; } .title { @@ -161,18 +160,10 @@ a.title h1 { font-weight: 400; } -nav { - text-align: left; - margin-bottom: 20px; -} -nav a { - margin-right: 8px; - text-decoration: none !important; -} -nav a:hover { - text-decoration: underline 0.5px !important; +nav a { + margin-right: 8px; } footer { @@ -811,7 +802,6 @@ nav { header { margin-top: 30px; - margin-bottom: 2rem; display: block; } diff --git a/layouts/shortcodes/recent-posts.html b/layouts/shortcodes/recent-posts.html index a666a4c..55f7cd4 100644 --- a/layouts/shortcodes/recent-posts.html +++ b/layouts/shortcodes/recent-posts.html @@ -1,136 +1,62 @@ -{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ -$recent := first 6 $pages.ByDate.Reverse }} +{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ $recent := first 12 $pages.ByDate.Reverse }}
- +

最近更新

{{ if $recent }} - {{ range $index, $page := $recent }} -
-

- {{ .Title }} -

- -{{ if ne (.Params.showMeta | default true) false }} - -{{ end }} - - - - - - - - - - - - - - - - - - - - - - - - -
- {{ end }} + {{ else }}
暂无文章
- - + {{ end }}
- -{{ end }} - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3