fix: dates in i18n format

This commit is contained in:
Ewen 2023-08-09 21:18:31 +02:00
parent 59e911e05d
commit 49c820a20a
3 changed files with 4 additions and 3 deletions

View file

@ -32,7 +32,7 @@
<a href="{{ .Permalink }}" class="h3 my-3 pt-0">{{ .Title | markdownify }}</a>
<div class="mb-3 post-meta">
{{ if not .Params.HideDate }}
<span>{{ .Date.Format "02 January 2006" }}</span>
<span>{{ (time .Date) | time.Format (.Params.date_format | default "02 January 2006" ) }}</span>
{{ end }}
</div>
<p class="card-text">{{ .Summary }}</p>

View file

@ -10,7 +10,7 @@
{{ partial "tags" .Params.tags }}
{{ end }}
</div>
<span class="article-date">{{ i18n "published" }} <a href="{{ .CurrentSection.URL }}">{{ .CurrentSection.Name }}</a> {{ i18n "on" }} {{ .Date.Format "2006-01-02" }}. {{ i18n "readingTime" }} {{ i18n "readingTimeValue" .ReadingTime }}.</span>
<span class="article-date">{{ i18n "published" }} <a href="{{ .CurrentSection.URL }}">{{ .CurrentSection.Name }}</a> {{ i18n "on" }} {{ (time .Date ) | time.Format (.Params.date_format | default "2 January 2006" ) }}. {{ i18n "readingTime" }} {{ i18n "readingTimeValue" .ReadingTime }}.</span>
<div class="post-content">
{{ .Content }}

View file

@ -30,6 +30,7 @@
class="text-primary">{{ . | title | humanize }}</a>
{{ end }}
<a href="{{ .Permalink }}" class="h3 my-3 pt-0">{{ .Title | markdownify }}</a>
COUCOU
<div class="mb-3 post-meta">
{{ if not .Params.HideDate }}
<span>{{ (time .Date) | time.Format (.Params.date_format | default "2 January 2006") }}</span>