layout: improve dates logic

* BETTER Improves a test to display lastmod only if it's bigger than
publishdate.

Co-Authored-by: Igor Milhit <igor@milhit.ch>
pull/31/head
iGor milhit 2019-08-27 19:20:28 +02:00
parent f3189b4478
commit 74181ecd54
Signed by: igor
GPG Key ID: 692D97C3D0228A99
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<ul class="post-info">
<li>Publié le&#x202F;: {{ dateFormat "2006-01-02" (default .Date (.PublishDate)) }}</li>
{{ if isset .Params "lastmod" }}
{{ if (and (isset .Params "lastmod") (gt .Lastmod .PublishDate)) }}
<li>Dernière mise à jour&#x202F;: {{ .Lastmod.Format "2006-01-02" }}</li>
{{ end }}
{{ with .Params.categories }}