feat(article/details): better article time display

This commit is contained in:
Jimmy Cai 2020-09-06 20:10:25 +02:00
parent 7f3d906f24
commit 3742a0775b
No known key found for this signature in database
GPG key ID: 3EA408E527F37B18

View file

@ -29,10 +29,12 @@
</h3> </h3>
{{ end }} {{ end }}
{{- if not .Date.IsZero -}}
<footer class="article-time"> <footer class="article-time">
{{ (resources.Get "icons/clock.svg").Content | safeHTML }} {{ (resources.Get "icons/clock.svg").Content | safeHTML }}
<time data-timeago="true" datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'> <time class="article-time--published">
{{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}} {{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}}
</time> </time>
</footer> </footer>
{{- end -}}
</div> </div>