summaryrefslogtreecommitdiff
path: root/layouts/partials/single/dates.html
blob: 080e37b1909741188af45f9a536109ab78dfc879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{{ $pubdate := .PublishDate.Format "2006-01-02" }}
{{ $lastmod := .Lastmod.Format "2006-01-02" }}

{{ $file := .File.LogicalName }}
{{ $path := .File.Path }}
{{ $lastmodhash := .GitInfo.Hash }}

<aside class="publish-date">
  {{ if eq $pubdate $lastmod }}

  Published: <time datetime="{{ $pubdate }}">
    <a href="{{$.Site.Params.repoUrl}}/commit/{{$lastmodhash}}">{{ $lastmod }}</a>
  </time>
  {{ else }}

  Originally published: 

  <time datetime="{{ $pubdate }}">{{ $pubdate }}</time>;
  updated: <time datetime="{{ $lastmod }}">
    <a href="{{$.Site.Params.repoUrl}}/commit/{{$lastmodhash}}">{{ $lastmod }}</a>
  </time>
</aside>
  {{ end }}