From 16c2c56aec8f76cdd3947f4e783e695ea0141ee5 Mon Sep 17 00:00:00 2001 From: Wouter Groeneveld Date: Mon, 30 Jul 2018 13:36:34 +0200 Subject: [PATCH] structured data update na https://search.google.com/structured-data/testing-tool --- config.toml | 2 ++ layouts/partials/head.html | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 8f867aa..b419453 100644 --- a/config.toml +++ b/config.toml @@ -6,6 +6,8 @@ disqusShortname = "" googleAnalytics = "UA-122825031-1" publishDir = "docs" enableEmoji = true +# for .Lastmod to work with .GitInfo: --enableGitInfo https://gohugo.io/variables/git/ +enableGitInfo = true [Author] name = "Wouter Groeneveld" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 279fa9d..29ac8a6 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -74,13 +74,15 @@ "copyrightHolder" : "{{ .Site.Author.name }}", "copyrightYear" : "{{ .Date.Format "2006" }}", "datePublished": "{{ .Date }}", - "dateModified" : "{{ .Date }}", + "dateModified" : "{{ .Lastmod }}", "url" : "{{ .Permalink }}", "wordCount" : "{{ .WordCount }}", {{ if .Keywords }} "keywords" : [ {{ range .Keywords }}"{{ . }}",{{ end }}"{{ .Title }}" ] {{ else if .Params.tags }} "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"{{ .Title }}" ] + {{ else }} + "keywords": [ "{{ .Title }}" ] {{ end }} }