blog/layouts/partials/post-info.html

57 lines
2.1 KiB
HTML

{{ $dateFormat := "2006-01-02" }}
{{ if site.Params.dateFormat }}
{{ $dateFormat = site.Params.dateFormat }}
{{ end }}
{{ $machineDateFormat := "2006-01-02" }}
{{ $lastmod := .Lastmod }}
{{ if .Params.lastmod }}
{{ $lastmod = .Params.lastmod }}
{{ end }}
<div class="post-info noselect">
{{ if .Params.date }}
<div class="post-date dt-published">
<time datetime="{{ .Params.date.Format $machineDateFormat }}">
{{- .Params.date.Format $dateFormat -}}
</time>
{{ if and $lastmod (ne $lastmod .Date) -}}
[{{ i18n "lastMod" }} <time datetime="{{ $lastmod.Format $machineDateFormat }}">
{{- $lastmod.Format $dateFormat -}}
</time>]
{{- end }}
</div>
{{ end }}
<a class="post-hidden-url u-url" href="{{ .RelPermalink }}">{{ .RelPermalink }}</a>
<a href="{{ site.BaseURL }}" class="p-name p-author post-hidden-author h-card" rel="me">{{ .Params.author | default site.Params.author }}</a>
<div class="post-taxonomies">
{{ if .Params.categories }}
<ul class="post-categories">
{{ range $cat_name := .Params.categories }}
{{ $cat_url := (printf "/categories/%s" $cat_name | urlize ) }}
<li><a href="{{ $cat_url }}">{{ $cat_name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ if .Params.tags }}
<ul class="post-tags">
{{ range $tag_name := .Params.tags }}
{{ $tag_url := (printf "/tags/%s" ($tag_name | urlize)) }}
<li><a href="{{ $tag_url }}">#{{ $tag_name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ if .Params.authors }}
<ul class="post-authors">
{{ range $author_name := .Params.authors }}
{{ $author := (site.GetPage (printf "/authors/%s" $author_name | urlize )) }}
<li><a href="{{ $author.RelPermalink }}">@{{ $author_name }}</a></li>
{{ end }}
</ul>
{{ end }}
</div>
</div>