From c1d1b92fccbbab2bc9abd395f92c4603e8854be2 Mon Sep 17 00:00:00 2001 From: MacRat Date: Wed, 24 Jan 2024 20:37:32 +0900 Subject: [PATCH] fix(seo): remove invalid dateModified from LD+JSON --- templates/blog/post.html | 2 +- templates/default.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/blog/post.html b/templates/blog/post.html index c276ba3b..cddd2edc 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -9,7 +9,7 @@ "@type": "BlogPosting", "headline": "{{.Title}}", "datePublished": "{{.Published.Format "2006-01-02T15:04:05Z07:00"}}", - "dateModified": "{{.Modified.Format "2006-01-02T15:04:05Z07:00"}}", + {{if not .Modified.IsZero}}"dateModified": "{{.Modified.Format "2006-01-02T15:04:05Z07:00"}}",{{end}} {{if .Image}} "image": [ {{range .Image}} diff --git a/templates/default.html b/templates/default.html index ccbdef8d..664786fe 100644 --- a/templates/default.html +++ b/templates/default.html @@ -9,7 +9,7 @@ "@type": "Article", "headline": "{{.Title}}", "datePublished": "{{.Published.Format "2006-01-02T15:04:05Z07:00"}}", - "dateModified": "{{.Modified.Format "2006-01-02T15:04:05Z07:00"}}", + {{if not .Modified.IsZero}}"dateModified": "{{.Modified.Format "2006-01-02T15:04:05Z07:00"}}",{{end}} {{if .Image}} "image": [ {{range .Image}}