1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-24 13:10:18 +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"> <div class="blog-post">
<h2 class="blog-post-title"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a></h2> <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 }} {{ .Summary }}
<a href='{{ .Permalink }}'><nobr>Read more →</nobr></a> <a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
</div> <!-- /.blog-post --> </div> <!-- /.blog-post -->