summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-03-08 11:00:14 +0800
committereltrac <hi@eltr.ac>2026-03-08 11:00:14 +0800
commit294ad30fe625cebc41fe1927cf77f0cafc8668ba (patch)
treeaafacf8663d3a18dd063bdb620aa7ede3028f4c8
parent1a5242df3e9e91ef69b497634080d9f9e13f64ec (diff)
feat: show archvied and pinned categorises
-rw-r--r--layouts/_partials/taxonomy/all-categories.html14
-rw-r--r--layouts/_partials/taxonomy/archived-categories.html16
-rw-r--r--layouts/taxonomy.html4
3 files changed, 28 insertions, 6 deletions
diff --git a/layouts/_partials/taxonomy/all-categories.html b/layouts/_partials/taxonomy/all-categories.html
index 85a228fe..7cb5813a 100644
--- a/layouts/_partials/taxonomy/all-categories.html
+++ b/layouts/_partials/taxonomy/all-categories.html
@@ -1,29 +1,31 @@
+<p class="text-sm text-secondary">* 表示常驻系列,其他系列可能会在完成后停止更新<p>
<!-- Display Categories -->
<div class="md:relative outbox md:h-[20rem] md:w-full">
<section class="md:overflow-x-auto md:absolute md:left-0 md:right-0">
<div class="flex flex-wrap justify-between md:flex-nowrap md:gap-6">
<hr />
- {{ range sort .Site.Taxonomies.categories ".Count" "desc" }}
+ {{ range sort (sort .Site.Taxonomies.categories ".Count" "desc") ".Page.Params.pinned" "desc" }}
+ {{ if not .Page.Params.archive }}
<a href="{{ .Page.RelPermalink }}"
class="block hover:no-underline hover:-transform-translate-y-2 transition-transform
md:writing-vertical"
style="view-transition-name: category-{{ .Page.Title }};">
<div>
- <h3 class="mx-2">
- {{ with .Page.Params.icon }}
- <span class="inline-block">{{ . }}</span>
- {{ end }}
- <span class="xerox">《{{ .Page.LinkTitle }}》</span>
+ <h3 class="mx-2 xerox">
+ 《{{ .Page.LinkTitle }}》
+ {{ if .Page.Params.pinned }}*{{ end }}
</h3>
<p class="m-0 text-secondary mt-4">{{ .Page.Params.description | markdownify }}</p>
</div>
</a>
<hr />
+ {{ end }}
{{ end }}
</div>
</section>
</div>
+
<p class="mt-4">
<a class="small-button" href="/categories/uncategorized/">
查看随笔 <span class="text-secondary">→</span>
diff --git a/layouts/_partials/taxonomy/archived-categories.html b/layouts/_partials/taxonomy/archived-categories.html
new file mode 100644
index 00000000..26ed68d8
--- /dev/null
+++ b/layouts/_partials/taxonomy/archived-categories.html
@@ -0,0 +1,16 @@
+<ul class="list-none p-0">
+ {{ range .Site.Taxonomies.categories }}
+ {{ if .Page.Params.archive }}
+ <li class="flex justify-between items-center gap-4">
+ <a class="flex-shrink-0" href="{{ .Page.RelPermalink }}">
+ <h3 class="xerox">《{{ .Page.LinkTitle }}》</h3>
+ </a>
+ <div class="w-full"><hr class="m-0" /></div>
+ <span class="text-secondary font-mono flex-shrink-0">
+ {{ T "archivePage.postCountMonthly" (len .Pages) }}
+ </span>
+ </li>
+ {{ end }}
+ {{ end }}
+</ul>
+
diff --git a/layouts/taxonomy.html b/layouts/taxonomy.html
index 1a00ef86..600d4d03 100644
--- a/layouts/taxonomy.html
+++ b/layouts/taxonomy.html
@@ -6,6 +6,10 @@
</div>
<h2>文章系列</h2>
{{ partial "taxonomy/all-categories.html" . }}
+ <hr />
+ <h2>尘封的系列</h2>
+ <p>这些文章系列已经不再更新。</p>
+ {{ partial "taxonomy/archived-categories.html" . }}
</article>
{{ partial "footer.html" . }}
{{ end }}