Use locale-aware alias for date formatting (#115)
":date_medium" matches "Jan 2, 2006" in english locales while adapting to hugo's configured locale.
This commit is contained in:
parent
e16b28fa10
commit
d8819d5eee
|
@ -9,7 +9,7 @@
|
||||||
{{- range .Data.Pages -}}
|
{{- range .Data.Pages -}}
|
||||||
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
|
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
|
||||||
<li class="post">
|
<li class="post">
|
||||||
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
|
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
|
||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<article>
|
<article>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h1 class="title">{{ .Title }}</h1>
|
<h1 class="title">{{ .Title }}</h1>
|
||||||
<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
|
<div class="meta">Posted on {{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
|
||||||
</div>
|
</div>
|
||||||
{{ if isset .Params "tldr" }}
|
{{ if isset .Params "tldr" }}
|
||||||
<div class="tldr">
|
<div class="tldr">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{{- range .Data.Pages -}}
|
{{- range .Data.Pages -}}
|
||||||
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
|
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
|
||||||
<li class="post">
|
<li class="post">
|
||||||
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
|
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
|
||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
<section class="list-item">
|
<section class="list-item">
|
||||||
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
|
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
|
||||||
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
|
<time>{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
|
||||||
<br>{{ template "partials/pagedescription.html" . }}
|
<br>{{ template "partials/pagedescription.html" . }}
|
||||||
<a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
|
<a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue