mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
38 lines
1.7 KiB
HTML
38 lines
1.7 KiB
HTML
{{- $categories := slice -}}
|
|
{{- range .Params.categories -}}
|
|
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
|
|
{{- $categories = $categories | append (
|
|
printf `<a href="%v" class="post-category" title="%v">%v %v</a>`
|
|
(partial "function/escapeurl.html" $category.RelPermalink)
|
|
(printf "%v - %v" (T "category") $category.Title)
|
|
(dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html")
|
|
$category.Title
|
|
) -}}
|
|
{{- end -}}
|
|
{{- $categoriesStr := delimit $categories " " -}}
|
|
|
|
{{- $collections := slice -}}
|
|
{{- range .Params.collections -}}
|
|
{{- $collection := partialCached "function/path.html" . . | printf "/collections/%v" | $.Site.GetPage -}}
|
|
{{- $collections = $collections | append (
|
|
printf `<a href="%v" class="post-collection" title="%v">%v %v</a>`
|
|
(partial "function/escapeurl.html" $collection.RelPermalink)
|
|
(printf "%v - %v" (T "collection") $collection.Title)
|
|
(dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html")
|
|
$collection.Title
|
|
) -}}
|
|
{{- end -}}
|
|
{{- $collectionStr := delimit $collections " " -}}
|
|
|
|
{{- if .Params.categories | or .Params.collections -}}
|
|
<span class="post-included-in">
|
|
{{- if not .Params.collections -}}
|
|
{{- dict "Categories" $categoriesStr | T "single.includedIn.categories" | safeHTML -}}
|
|
{{- else if not .Params.categories -}}
|
|
{{- dict "Collections" $collectionStr | T "single.includedIn.collections" | safeHTML -}}
|
|
{{- else -}}
|
|
{{- dict "Categories" $categoriesStr "Collections" $collectionStr | T "single.includedIn.both" | safeHTML -}}
|
|
{{- end -}}
|
|
</span>
|
|
{{- end -}}
|