hugo-theme-readable/layouts/partials/metadata.html

26 lines
890 B
HTML
Raw Normal View History

2023-01-30 13:14:33 -06:00
{{ $dateTime := .PublishDate.Format "2006-01-02" }}
2023-07-20 21:43:46 -05:00
{{ $lastmodTime := .Lastmod.Format "2006-01-02" }}
2023-01-30 13:14:33 -06:00
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
<section class="metadata">
2023-01-30 13:14:33 -06:00
<i data-feather="calendar"></i>
{{ if .PublishDate }}
2024-05-19 13:15:23 -05:00
{{ if and (ne $lastmodTime $dateTime) (gt .Lastmod .Date) }}
<time datetime="{{ $lastmodTime }}">{{ .Lastmod.Format $dateFormat }}</time>
(first posted <time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time>)
{{ else }}
Date Published: <time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time>
{{ end }}
2023-01-30 13:14:33 -06:00
{{ end }}
2024-05-19 13:15:23 -05:00
{{ with .Params.tags }}
<br>
Tags: <i data-feather="tag"></i>
{{ range . }}
{{ $href := print "/tags/" (urlize .) }}
<a class="btn btn-sm btn-outline-dark tag-btn" href="{{ $href }}">{{ . }}</a>
{{ end }}
</section>
{{ else }}
</section>
2023-07-20 21:43:46 -05:00
{{ end }}
2024-05-19 13:15:23 -05:00