1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-12-21 10:02:17 +01:00

layouts/_default/list.html: Use .Date for modification time on nodes

I'm not sure if it really matters to bots who will parse this (it's
much more important on content pages of course), but using .Date on
nodes like the homepage and taxonomy terms pages will set the date
to be that of the latest post in that range—to me this does indeed
seem to be "time when the object was last updated"[0].

[0] https://developers.facebook.com/docs/reference/opengraph/object-type/website/
This commit is contained in:
Alan Orth 2017-01-22 14:58:13 +02:00
parent 868b5b3c13
commit d6cc7839ef
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -10,6 +10,10 @@
"@type": "Person", "@type": "Person",
"name": {{ .Site.Params.author }} "name": {{ .Site.Params.author }}
}, },
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{ if not .Date.IsZero }}
"dateModified": {{ .Date.Format $ISO8601 }},
{{ end }}
{{ with .Site.Social.GooglePlus }} {{ with .Site.Social.GooglePlus }}
"publisher": {{ printf "%s" . }}, "publisher": {{ printf "%s" . }},
{{ end }} {{ end }}