1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-12-25 03:34:29 +01:00

layouts: Improve usage of datetime

Use the date format from the config, and print it in a time tag.

See: https://golang.org/pkg/time/
This commit is contained in:
Alan Orth 2016-08-28 22:14:01 +03:00
parent 8b7d70e3c0
commit f76b5a069a
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -1,6 +1,6 @@
<div class="blog-post">
<h2 class="blog-post-title"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a></h2>
<p class="blog-post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} by <a href="#">Mark</a></p>
<p class="blog-post-meta"><time datetime="{{ .Date }}">{{ .Date.Format .Site.Params.date_format }}</time> by <a href="#">Mark</a></p>
{{ .Summary }}
<a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
</div> <!-- /.blog-post -->