hugo-geekdoc/layouts/partials/posts/metadata.html
Robert Kaussow 5c22ce57dc
feat: add multilingual mode support (#241)
BREAKING CHANGE:  Layout file renamed ´layouts/partials/page-footer.html → layouts/partials/menu-nextprev.html`. If you use overrides, you might need to change the filenames as well.
2022-01-23 13:21:44 +01:00

55 lines
1.5 KiB
HTML

<span class="no-wrap">
<svg class="icon gdoc_date"><use xlink:href="#gdoc_date"></use></svg>
<span class="gdoc-post__tag">
<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ if .Lastmod.After (.Date.AddDate 0 0 1) }}
{{ i18n "posts_update_prefix" }}
{{ end }}
{{ .Lastmod.Format "Jan 2, 2006" }}
</time>
</span>
</span>
<span class="no-wrap">
<svg class="icon gdoc_timer"><use xlink:href="#gdoc_timer"></use></svg>
<span class="gdoc-post__tag">{{ i18n "posts_read_time" .ReadingTime }}</span>
</span>
{{ $tc := 0 }}
{{ with .Params.tags }}
{{ range sort . }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }}
{{ if eq $tc 0 }}
<span class="no-wrap">
<svg class="icon gdoc_bookmark"><use xlink:href="#gdoc_bookmark"></use></svg>
{{ template "post-tag" dict "name" $name "page" . }}
</span>
{{ else }}
{{ template "post-tag" dict "name" $name "page" . }}
{{ end }}
{{ end }}
{{ $tc = (add $tc 1) }}
{{ end }}
{{ end }}
{{ define "post-tag" }}
<span class="gdoc-post__tag gdoc-button">
<a
class="gdoc-button__link"
href="{{ .page.RelPermalink }}"
title="All posts tagged with '{{ .name }}'"
>
{{ .name }}
</a>
</span>
{{ end }}
{{ define "post-author" }}
<span class="gdoc-post__tag gdoc-button">
<a class="gdoc-button__link" href="{{ .page.RelPermalink }}" title="All posts of this author">
{{ .name }}
</a>
</span>
{{ end }}