tpl: Improve generation of OpenGraph date tags
authorAlan Orth <alan.orth@gmail.com>
Sun, 22 Jan 2017 14:06:41 +0000 (16:06 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 23 Jan 2017 14:31:30 +0000 (21:31 +0700)
commit95ad3ad2fa3e6f4514166b47b77f051d280c16e9
tree20608e627fa861842586925e2c4ec56ba4b9aef2
parent91c569c7e58d978c34f7de83e28e896dad37a5d4
tpl: Improve generation of OpenGraph date tags

Allow all nodes/pages to use date-related OpenGraph meta tags, not
only sites which are using the as-of-yet unfinished .Site.Authors
functionality.

Improve compliance of tags with Facebook's OpenGraph docs for the
"website" and "article" types[0][1]. Also, use the proper tag for
modification date (og:update_time vs article:modified_time).

Generate date published using either .PublishDate or .Date, and use
.Lastmod for modification date, which can use the new enableGitInfo
functionality from Hugo 0.18, but seamlessly falls back to .Date if
the site does not have this enabled/supported.

[0] https://developers.facebook.com/docs/reference/opengraph/object-type/website/
[1] https://developers.facebook.com/docs/reference/opengraph/object-type/article/
tpl/template_embedded.go