hugo-bearblog/layouts/_default/list.html
Akira Baruah be0ba327e3 feat: enable optional custom date format
Adds a .Site.Params.dateFormat setting to let users specify a Hugo-style
date format string for content. Previously, the date format was
hardcoded to "02 Jan, 2006", presumably to match the original BearBlog
style. This format gets used by default if the new "dateFormat" setting
is absent from the site config.
2021-04-12 17:18:41 +02:00

39 lines
870 B
HTML

{{ define "main" }}
<content>
{{ if .Data.Singular }}
<h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3>
<small>
<a href="{{ "/blog" | relURL }}">Remove filter</a>
</small>
{{ end }}
<ul class="blog-posts">
{{ range .Pages }}
<li>
<span>
<i>
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
{{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }}
</time>
</i>
</span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ else }}
<li>
No posts yet
</li>
{{ end }}
</ul>
{{ if .Data.Singular }}
{{else}}
<small>
<div>
{{ range .Site.Taxonomies.tags }}
<a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>&nbsp;
{{ end }}
</div>
</small>
{{ end }}
</content>
{{ end }}