From d6cc7839ef0f0616e360719f2d8a735f9e430a44 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 22 Jan 2017 14:58:13 +0200 Subject: [PATCH] layouts/_default/list.html: Use .Date for modification time on nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/ --- layouts/_default/list.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3aa7d31..dacefe8 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -10,6 +10,10 @@ "@type": "Person", "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 }} "publisher": {{ printf "%s" . }}, {{ end }}