hugo-stanley/layouts/partials/article-header.html

31 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2020-03-03 18:56:59 +01:00
<!--<p><img src="img/user.png" width="50px" height="50px">
<ba>Stanley Stinson</ba>
</p>-->
{{- $dateFormat := site.Params.dateFormat -}}
{{- if not $dateFormat -}}{{- $dateFormat = "2006-01-02" -}}{{- end -}}
{{- $lastmodFormat := "" -}}
{{- $lastmod := .Lastmod -}}
{{- if $lastmod -}}
{{- $lastmodFormat = $lastmod.Format $dateFormat -}}
{{- end -}}
{{- if .Date -}}
{{- $dateFormat := .Date.Format $dateFormat -}}
<p class="article date">
<bd>{{- $dateFormat -}}</bd>
{{- if and ($lastmod.After .Date) (ne $lastmodFormat $dateFormat) -}}
<span class="lastmod">{{- printf (T "edited") $lastmodFormat -}}</span>
{{- end -}}
{{- if or (eq .Params.readingTime true) (and (not (eq .Params.readingTime false)) (eq site.Params.readingTime true)) -}}
<span class="reading-time">{{ T "readingTime" .ReadingTime }}</span>
{{- end -}}
{{- if .IsTranslated -}}
<span class="langs">
{{- range .Translations -}}
<span class="lang"><a href="{{- .RelPermalink -}}">{{- .Lang -}}</a></span>
{{- end -}}
</span>
{{- end -}}
</p>
{{- end -}}