diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-25 23:06:54 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-25 23:06:54 +0800 |
| commit | 9ff8c08731833841b81671df0d7ceae008a4b5ef (patch) | |
| tree | d85aa3298d7dda5427423a167afe564ed578b985 | |
| parent | 19d0e7d6c8c42c78070606b3faf69e5158295b56 (diff) | |
chore: rename 分类 to 专栏 and style uncategorized list
| -rw-r--r-- | assets/css/components/_postlist.scss | 7 | ||||
| -rw-r--r-- | content/categories/_index.md | 2 | ||||
| -rw-r--r-- | content/categories/uncategorized.md | 4 | ||||
| -rw-r--r-- | i18n/zh.yml | 2 | ||||
| -rw-r--r-- | layouts/_default/taxonomy.html | 7 | ||||
| -rw-r--r-- | layouts/_default/uncategorized.html | 33 |
6 files changed, 35 insertions, 20 deletions
diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss index 5cc30856..785d9f7d 100644 --- a/assets/css/components/_postlist.scss +++ b/assets/css/components/_postlist.scss @@ -106,11 +106,13 @@ .term-list { .term-list-posts { - list-style: none; + &:not(ol) { + list-style: none; + } padding-inline-start: 0; display: flex; flex-direction: column; - gap: 0.5rem; + gap: 1rem; li { display: flex; justify-content: space-between; @@ -119,6 +121,7 @@ font-size: 0.9rem; font-family: var(--mono-font-family); color: var(--secondary-text-color); + flex-shrink: 0; } .posts-subtitle { color: var(--secondary-text-color); diff --git a/content/categories/_index.md b/content/categories/_index.md index 1080d041..6bfa05ea 100644 --- a/content/categories/_index.md +++ b/content/categories/_index.md @@ -1,3 +1,3 @@ --- -title: 分类 +title: 专栏 --- diff --git a/content/categories/uncategorized.md b/content/categories/uncategorized.md index bfb38ee7..47beb44b 100644 --- a/content/categories/uncategorized.md +++ b/content/categories/uncategorized.md @@ -1,4 +1,6 @@ --- -title: 未分类文章 +title: 随笔 layout: uncategorized --- + +这里列出了所有不属于任何专栏的文章,也就是随笔。 diff --git a/i18n/zh.yml b/i18n/zh.yml index a827365d..a354fc09 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -12,7 +12,7 @@ footer: searchInstruction: '⌘+K 在任何地方搜索' postNav: latest: '最新' - categories: '分类' + categories: '专栏' tags: '标签' cards: 最近在学 moreLinks: diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index ad1179e2..14be0c9a 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -71,10 +71,11 @@ {{ end }} {{ end }} </section> + + <p class="uncategorized-link-container"> + <a class="uncategorized-link" href="/categories/uncategorized/">查看随笔</a> + </p> {{ end }} - <p class="uncategorized-link-container"> - <a class="uncategorized-link" href="/categories/uncategorized/">查看未分类文章</a> - </p> </article> {{ partial "footer.html" . }} {{ end }} diff --git a/layouts/_default/uncategorized.html b/layouts/_default/uncategorized.html index 1f777025..afec928a 100644 --- a/layouts/_default/uncategorized.html +++ b/layouts/_default/uncategorized.html @@ -2,19 +2,28 @@ <article class="posts termlist-page"> {{ partial "components/post-page-header.html" . }} {{ partial "components/breadcrumbs.html" . }} - <div class="post-content"> - <!-- Uncategorized --> - {{ $uncategorized := where (where .Site.RegularPages "Section" "posts") "Params.categories" "==" nil }} - {{ if $uncategorized }} - <section class="uncategorized-posts"> - <ol> - {{ range $uncategorized }} - <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> - {{ end }} - </ol> - </section> - {{ end }} + <div class="post-content markdown-body"> + <p>{{ .Content }}</p> </div> + <!-- Uncategorized --> + {{ $uncategorized := where (where .Site.RegularPages "Section" "posts") "Params.categories" "==" nil }} + {{ if $uncategorized }} + <section class="uncategorized-posts term-list"> + <ol class="term-list-posts"> + {{ range $uncategorized }} + <li> + <a href="{{ .RelPermalink }}" data-umami-event="Click Post Link from Uncategorized"> + {{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span> + {{ end }} + </a> + <time> + {{ .Date.Format "2006-1-2" }} + </time> + </li> + {{ end }} + </ol> + </section> + {{ end }} </article> {{ partial "footer.html" . }} {{ end }} |
