summaryrefslogtreecommitdiffstats
path: root/layouts/partials/post-meta/date.html
blob: b2537b7365074509c5326c91401cc100b392fe8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $date := .Date | time.Format (site.Params.dateFormat | default "January 02, 2006") }}
{{ $lastmod := .Lastmod | time.Format (site.Params.dateFormat | default "January 02, 2006") }}

{{ i18n "published_on" }}
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
    {{ $date }}
</time>

{{/* Check that lastmod exists and is greater than date
    (i.e. the last modified date must be after the publish date) */}}
{{ if and (ne $lastmod $date) (gt .Lastmod .Date) }}
    <span>•</span>
    {{ i18n "updated_on" }}
    <time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">
        {{ $lastmod }}
    </time>
{{ end }}