Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pfadfinder-konstanz/hugo-dpsg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/post_meta/categories.html')
-rw-r--r--layouts/partials/post_meta/categories.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/post_meta/categories.html b/layouts/partials/post_meta/categories.html
new file mode 100644
index 0000000..8ab4202
--- /dev/null
+++ b/layouts/partials/post_meta/categories.html
@@ -0,0 +1,16 @@
+{{- $taxo := "categories" -}}
+{{- with .Param $taxo -}}
+<div class="meta__item-categories meta__item">
+ {{- partial "svg/category.svg" (dict "class" "meta__icon") -}}
+ <span class="meta__text">
+ {{- range $index, $category := . }}
+ {{- $url := urls.Parse ($category | urlize) -}}
+ {{- $path := $url.Path -}}
+ {{- with $.Site.GetPage (printf "/%s/%s" $taxo $path) }}
+ {{- if gt $index 0 }}, {{ end -}}
+ <a class="meta__link" href="{{ .RelPermalink }}" rel="category">{{ .Title }}</a>
+ {{- end }}
+ {{- end }}
+ </span>
+</div>
+{{- end }} \ No newline at end of file