w2ng/themes/hugo-w2ng/layouts/partials/taxonomy.html
2020-01-08 20:57:27 +08:00

34 lines
1.2 KiB
HTML

{{ $currentPage := . }}
<div class="flex flex-col md:flex-row justify-between ">
{{ with .Params.categories }}
<ul class="flex justify-end text-gray-800" itemprop="articleSection">
{{ range . }}
<li class="pl-2 pr-0 md:pl-0 md:pr-2">
<a href="{{ . | printf "categories/%s" | relURL }}" rel="category">
{{- if eq ($currentPage.Scratch.Get "taxonomy") (add "categories" .) -}}
<mark>{{- . -}}</mark>
{{- else -}}
{{- . -}}
{{- end -}}
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ with .Params.tags }}
<ul class="flex justify-end text-gray-700">
{{ range . }}
<li itemprop="keywords" class="pl-2 md:pl-4">
<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
{{- if eq ($currentPage.Scratch.Get "taxonomy") (add "tags" .) -}}
<mark>#{{- . -}}</mark>
{{- else -}}
#{{- . -}}
{{- end -}}
</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ $currentPage.Scratch.Delete "taxonomy" }}