[ZZO] Display modification date only if different than creation date
Also take into account .lastmod set in file, not only .GitInfo (which still has precedence in default configuration).
This commit is contained in:
parent
348906d207
commit
07846d91aa
|
@ -1,6 +1,13 @@
|
||||||
{{ $params := .Params }}
|
{{ $params := .Params }}
|
||||||
<div class="single__infos">
|
<div class="single__infos">
|
||||||
<time class="single__info" title="{{ i18n "tooltip-written" }}">📅 {{ .Date.Format (i18n "single-dateformat") }} </time> {{ if .GitInfo }} <time class="single__info" title="{{ i18n "tooltip-modified" }}"> 📝{{ .Lastmod.Format (i18n "single-dateformat") }} </time> {{ end }} · <span class="single__info" title="{{ i18n "tooltip-reading-time" }}"> ☕ {{ .ReadingTime }} {{ i18n "reading-time" }} </span>{{ with .Params.Author }}· <span class="single__info" title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }} {{ . }}</span>{{ end }}
|
<time class="single__info" title="{{ i18n "tooltip-written" }}">📅 {{ .Date.Format (i18n "single-dateformat") }} </time>
|
||||||
|
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||||
|
<time class="single__info" title="{{ i18n "tooltip-modified" }}"> 📝{{ .Lastmod.Format (i18n "single-dateformat") }} </time>
|
||||||
|
{{ end }}
|
||||||
|
· <span class="single__info" title="{{ i18n "tooltip-reading-time" }}"> ☕ {{ .ReadingTime }} {{ i18n "reading-time" }} </span>
|
||||||
|
{{ with .Params.Author }}
|
||||||
|
· <span class="single__info" title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }} {{ . }}</span>
|
||||||
|
{{ end }}
|
||||||
<span class="single__info">
|
<span class="single__info">
|
||||||
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} · 👀<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
|
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} · 👀<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -18,7 +18,14 @@
|
||||||
<div class="summary-classic__content">
|
<div class="summary-classic__content">
|
||||||
<header>
|
<header>
|
||||||
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
|
<h5 class="title h5"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
|
||||||
<h6 class="subtitle caption"><time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time> {{ if .GitInfo }} <time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> · 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time> {{ end }} <span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> · ☕ {{ .ReadingTime }} {{ i18n "reading-time" }} </span>{{ with $.Param "author" }}· <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}✍️{{ end }} {{ . }}</span>{{ end }}</h6>
|
<h6 class="subtitle caption">
|
||||||
|
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time>
|
||||||
|
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
|
||||||
|
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> · 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
|
||||||
|
{{ end }}
|
||||||
|
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> · ☕ {{ .ReadingTime }} {{ i18n "reading-time" }} </span>
|
||||||
|
{{ with $.Param "author" }}· <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}✍️{{ end }} {{ . }}</span>{{ end }}
|
||||||
|
</h6>
|
||||||
</header>
|
</header>
|
||||||
<div>
|
<div>
|
||||||
<div class="summary-classic__text p2">
|
<div class="summary-classic__text p2">
|
||||||
|
|
Loading…
Reference in New Issue