diff options
author | Victoria Drake <hello@victoria.dev> | 2022-02-14 15:42:27 +0300 |
---|---|---|
committer | Victoria Drake <hello@victoria.dev> | 2022-02-14 15:42:27 +0300 |
commit | fade059bf543c62cb7a58e19137b0118bc20fc7d (patch) | |
tree | 80f4947daf7a38fb649e776ca1e9f90146700baa /layouts/blog/list.html | |
parent | 052a699484e0ce1d4ee24d294a0fb73b17a2d4bc (diff) |
Use layout identifiers for dates
- Adds new Hugo feature
(https://gohugo.io/functions/dateformat/#datetime-formatting-layouts)
enabling date localization in defaults
Diffstat (limited to 'layouts/blog/list.html')
-rw-r--r-- | layouts/blog/list.html | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/layouts/blog/list.html b/layouts/blog/list.html index d3aea07..e652c3d 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,31 +1,32 @@ {{ define "main" }} - <div class="container markdown top-pad"> - {{ .Content }} - </div> - <div class="container"> - {{ if .Site.Params.home.showLatest | default true }} - <h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2> - {{ range first 1 .Pages.ByPublishDate.Reverse }} - <div class="summary">{{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}{{ end }} - <h3 class="title is-3 strong-post-title"> - <a href="{{ .Permalink }}"> - {{ .Title | markdownify }} - </a> - </h3> - <div class="markdown"> - {{ .Summary }} - {{ if .Truncated }} - <a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a> - {{ end }} - </div> - </div> +<div class="container markdown top-pad"> + {{ .Content }} +</div> +<div class="container"> + {{ if .Site.Params.home.showLatest | default true }} + <h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2> + {{ range first 1 .Pages.ByPublishDate.Reverse }} + <div class="summary"> + {{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default ":date_medium") }}{{ end }} + <h3 class="title is-3 strong-post-title"> + <a href="{{ .Permalink }}"> + {{ .Title | markdownify }} + </a> + </h3> + <div class="markdown"> + {{ .Summary }} + {{ if .Truncated }} + <a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a> {{ end }} - {{ end }} - <h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2> - {{if .Site.Params.home.allPostsArchiveFormat}} - {{ partialCached "blog/archive.html" .}} - {{else}} - {{ partialCached "blog/li.html" . }} - {{end}} + </div> </div> + {{ end }} + {{ end }} + <h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2> + {{if .Site.Params.home.allPostsArchiveFormat}} + {{ partialCached "blog/archive.html" .}} + {{else}} + {{ partialCached "blog/li.html" . }} + {{end}} +</div> {{ end }} |