Files
FixIt/layouts/_partials/single/post-included-in.html
T
Cell 5322a15ceb docs(layouts): add header comments to undocumented partials
Add `{{/* ... */}}` header comments to 25 partials that had no documentation,
enabling `pnpm gen:docs` to generate their reference docs. Also fix
base/head/index.html leading blank line that prevented parser matching.

Groups covered: base/, feed/, function/, home/, init/, plugin/, single/, store/, (root).
2026-07-23 12:56:40 +08:00

43 lines
1.6 KiB
HTML

{{- /*
Post categories and collections display partial.
Renders category and collection links with icons for the current page.
Displays categories only, collections only, or both depending on which are present.
*/ -}}
{{- $categories := slice -}}
{{- range .GetTerms "categories" -}}
{{- $categories = $categories | append (
printf `<a href="%v" class="post-category" title="%v">%v %v</a>`
(partial "function/escapeurl.html" .RelPermalink)
(printf "%v - %v" (T "category") .LinkTitle)
(dict "Class" "fa-regular fa-folder" | partial "plugin/icon.html")
.LinkTitle
) -}}
{{- end -}}
{{- $categoriesStr := delimit $categories "&ensp;" -}}
{{- $collections := slice -}}
{{- range .GetTerms "collections" -}}
{{- $collections = $collections | append (
printf `<a href="%v" class="post-collection" title="%v">%v %v</a>`
(partial "function/escapeurl.html" .RelPermalink)
(printf "%v - %v" (T "collection") .LinkTitle)
(dict "Class" "fa-solid fa-layer-group" | partial "plugin/icon.html")
.LinkTitle
) -}}
{{- end -}}
{{- $collectionStr := delimit $collections "&ensp;" -}}
{{- if .Params.categories | or .Params.collections -}}
<span class="post-included-in">
{{- if not .Params.collections -}}
&nbsp;{{- dict "Categories" $categoriesStr | T "single.includedIn.categories" | safeHTML -}}
{{- else if not .Params.categories -}}
&nbsp;{{- dict "Collections" $collectionStr | T "single.includedIn.collections" | safeHTML -}}
{{- else -}}
&nbsp;{{- dict "Categories" $categoriesStr "Collections" $collectionStr | T "single.includedIn.both" | safeHTML -}}
{{- end -}}
</span>
{{- end -}}