diff options
| author | eltrac <hi@eltr.ac> | 2026-03-08 14:41:19 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-08 14:41:19 +0800 |
| commit | fe0bafba4a126fef9c169bfefa09201a6ea400ca (patch) | |
| tree | 66b77deef5773a56f5f962ed3b65d8ac1330203c /layouts/_partials | |
| parent | 5ccd892f23ba9cfa7145fec7137a49eb2077a447 (diff) | |
| parent | c09ffa2e5b0db615f4a4614da7d4811616afdf4f (diff) | |
merge branch restructure
Diffstat (limited to 'layouts/_partials')
| -rw-r--r-- | layouts/_partials/posts/action-menu.html | 11 | ||||
| -rw-r--r-- | layouts/_partials/section-categories.html | 20 | ||||
| -rw-r--r-- | layouts/_partials/taxonomy/all-categories.html | 14 | ||||
| -rw-r--r-- | layouts/_partials/taxonomy/archived-categories.html | 16 |
4 files changed, 34 insertions, 27 deletions
diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index 215dc96a..d3544c1f 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -1,4 +1,13 @@ {{ $webmentions := index .Site.Data.webmentions .RelPermalink }} + +<!-- + some pages were moved, merge their webmention with old Data +--> +{{ $other_webmentions := index .Site.Data.webmentions (printf "/posts%s" .RelPermalink ) }} +{{ if $other_webmentions }} + {{ $webmentions = $webmentions | union $other_webmentions }} +{{ end }} + {{ $likes := slice }} {{ $replies := slice }} {{ $mentions := slice }} @@ -16,7 +25,7 @@ {{ partial "posts/action-area" . }} <details class="my-4 mb-5 no-mark"> - <summary class="cursor-pointer"> + <summary class="cursor-pointer flex"> {{ partial "posts/webmention-summary" (dict "likes" $likes "page" . diff --git a/layouts/_partials/section-categories.html b/layouts/_partials/section-categories.html deleted file mode 100644 index 40e6600e..00000000 --- a/layouts/_partials/section-categories.html +++ /dev/null @@ -1,20 +0,0 @@ -{{ $categories := slice }} -{{ range . }} - {{ with .Params.categories }} - {{ if not (in $categories .) }} - {{ $categories = $categories | append . }} - {{ end }} - {{ end }} -{{ end }} - -<div class="flex gap-2 flex-wrap"> - {{ range $categories }} - <a href="/categories/{{ . | urlize }}/" - class="text-size-lg px-3 py-2 - transition-colors duration-300 rounded-xl hover:no-underline - bg-slate-2/50 dark:bg-neutral-800/50 - hover:bg-[var(--text-color)] hover:text-[var(--block-background-color)]"> - {{ . }} - </a> - {{ end }} -</div> 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> + |
