mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
🐛 Fix: use dateFormat function to render localized dates
Co-authored-by: Stefano Ginobili <stefano.ginobili@gmail.com>
Co-authored-by: Cell <1024@lruihao.cn>
(cherry picked from commit 78416fa920)
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .Title -}}</a>
|
||||
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Date.Format }}'>
|
||||
{{- $.Site.Params.section.dateFormat | default "01-02" | .Date.Format -}}
|
||||
{{- .Date | dateFormat ($.Site.Params.section.dateFormat | default "01-02") -}}
|
||||
</span>
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="post-meta">
|
||||
{{- partial "single/post-author.html" . -}}
|
||||
|
||||
{{- with .Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format -}}
|
||||
{{- with .PublishDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||
<span class="post-publish" title='{{ "2006-01-02 15:04:05" | $.PublishDate.Format }}'>
|
||||
{{- printf `<time datetime="%v">%v</time>` . . | dict "Date" | T "single.publishedOnDate" | safeHTML -}}
|
||||
</span>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .Title -}}</a>
|
||||
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Lastmod.Format }}'>
|
||||
{{- with .Site.Params.section.dateformat | default "01-02" | .Lastmod.Format -}}
|
||||
{{- with .Lastmod | dateFormat (.Site.Params.section.dateformat | default "01-02") -}}
|
||||
{{- dict "Date" . | T "single.updatedOnDate" -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | $updateTime.Format -}}
|
||||
{{- with $updateTime | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
{{- dict "Date" . | T "single.expirationReminder" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-mod">
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | .Lastmod.Format) | T "single.updatedOnDate" }}">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
|
||||
{{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
{{- dict "Date" . | T "single.updatedOnDate" -}}
|
||||
{{- if $gitRepo -}}
|
||||
{{- with $.GitInfo -}}
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-meta-line">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | .PublishDate.Format -}}
|
||||
{{- with .PublishDate | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | $.PublishDate.Format) | T "single.publishedOnDate" }}">
|
||||
{{- dict "Class" "fa-regular fa-calendar-alt fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- printf `<time datetime="%v">%v</time>` . . | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
|
||||
{{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | $.Lastmod.Format) | T "single.updatedOnDate" }}">
|
||||
{{- dict "Class" "fa-regular fa-edit fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- printf `<time datetime="%v">%v</time>` . . | safeHTML -}}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .Title -}}</a>
|
||||
<span class="archive-item-date" title={{ "2006-01-02 15:04:05" | .Date.Format }}>
|
||||
{{- $.Site.Params.list.dateFormat | default "01-02" | .Date.Format -}}
|
||||
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Date.Format }}'>
|
||||
{{- .Date | dateFormat ($.Site.Params.list.dateFormat | default "01-02") -}}
|
||||
</span>
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user