diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-18 16:00:15 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-18 16:00:15 +0800 |
| commit | aad15bc05e1ab8b891925a892601a2662181bf54 (patch) | |
| tree | 00832b5e3a6663567077eba0198691b364ad7630 /layouts | |
| parent | dfd262b1b14e1c6952bc88309b0246023b35185f (diff) | |
feat: separate periodic posts and normal post series
Former-commit-id: 6c3d492ac40b4ccf3d510f38b011f695207ee398
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/taxonomy.html | 74 |
1 files changed, 53 insertions, 21 deletions
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 6aaf3d46..8f449506 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -18,30 +18,62 @@ <!-- Display Categories --> {{ if eq .Type "categories" }} {{ partial "components/welcome.html" . }} - <section class="taxonomy-categories"> + {{ $featured := slice "稻草人周刊" "年终总结" "揽物日志" }} + <h2>周期性刊物</h2> + <section class="taxonomy-categories"> {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} - <div class="taxonomy-categories-item"> - <h3 class="category-title"> - <a href="{{ .Page.RelPermalink }}"> - {{ with .Page.Params.icon }}<span>{{ . }}</span>{{ end }} {{ .Page.LinkTitle }} - </a> - </h3> - <p class="category-description">{{ .Page.Params.description | markdownify }}</p> - <ul class="category-articles"> - {{ range first 6 .Pages }} - <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> - {{ end }} - </ul> - {{ if gt .Count 6 }} - <a class="category-link" - href="{{ .Page.RelPermalink }}" - >阅读所有 {{ .Count }} 篇文章</a> - {{ end }} - </div> - {{ end }} - </section> + {{ if in $featured .Page.Title }} + <div class="taxonomy-categories-item"> + <h3 class="category-title"> + <a href="{{ .Page.RelPermalink }}"> + {{ with .Page.Params.icon }}<span>{{ . }}</span>{{ end }} {{ .Page.LinkTitle }} + </a> + </h3> + <p class="category-description">{{ .Page.Params.description | markdownify }}</p> + <ul class="category-articles"> + {{ range first 6 .Pages }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + </ul> + {{ if gt .Count 6 }} + <a class="category-link" + href="{{ .Page.RelPermalink }}" + >阅读所有 {{ .Count }} 篇文章</a> + {{ end }} + </div> + {{ end }} + {{ end }} + </section> + + <!-- Render Other Categories --> + <h2>文章系列</h2> + <section class="taxonomy-categories"> + {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} + {{ if not (in $featured .Page.Title) }} + <div class="taxonomy-categories-item"> + <h3 class="category-title"> + <a href="{{ .Page.RelPermalink }}"> + {{ with .Page.Params.icon }}<span>{{ . }}</span>{{ end }} {{ .Page.LinkTitle }} + </a> + </h3> + <p class="category-description">{{ .Page.Params.description | markdownify }}</p> + <ul class="category-articles"> + {{ range first 6 .Pages }} + <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + {{ end }} + </ul> + {{ if gt .Count 6 }} + <a class="category-link" + href="{{ .Page.RelPermalink }}" + >阅读所有 {{ .Count }} 篇文章</a> + {{ end }} + </div> + {{ end }} + {{ end }} + </section> {{ end }} + </article> {{ partial "footer.html" . }} {{ end }} |
