diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 81a259d0..6a327407 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -30,6 +30,8 @@ listDateFormat = "2/1/2006" # postSectionName = "blog" # relatedPosts = true # numberOfRelatedPosts = 3 +# Full link to license +#license = "https://creativecommons.org/licenses/by/4.0/" reversepagetitle = true # When set to 'true', the Window Title will be reversed to 'Title | Author' instead of the default 'Author | Title' diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ca76f8b8..c31ca871 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -137,6 +137,10 @@ + + {{- with .Site.Params.license -}} + + {{- end -}} {{ with .OutputFormats.Get "rss" -}} diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html index 694cb8be..9385afe0 100644 --- a/layouts/partials/schema.html +++ b/layouts/partials/schema.html @@ -7,7 +7,11 @@ "url": "{{ .Site.BaseURL }}", "description": "{{ .Site.Params.description }}", "thumbnailUrl": "{{ .Site.Params.Logo | absURL }}", - "license": "{{ .Site.Params.Copyright }}" + "license": "{{ .Site.Params.license}}" + {{ with .Site.Params.copyright }} + {{ $copyright := replace . "{{ YEAR }}" (now.Format "2006") }} + ,"copyrightYear": "{{ index (findRE `^\d{4}` $copyright 1) 0 }}" + {{ end }} } {{ else if .IsPage }} @@ -34,6 +38,11 @@ {{ end }}", + "license": "{{ .Site.Params.license}}", + {{ with .Site.Params.copyright }} + {{ $copyright := replace . "{{ YEAR }}" (now.Format "2006") }} + "copyrightYear": "{{ index (findRE `^\d{4}` $copyright 1) 0 }}", + {{ end }} "inLanguage": {{ .Site.LanguageCode | default "en-us" }}, "isFamilyFriendly": "true", "mainEntityOfPage": { @@ -56,7 +65,6 @@ "@type": "Person", "name": "{{ $author }}" }, - "copyrightYear" : "{{ .Date.Format "2006" }}", "dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}", "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}", "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",