Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Mooring <joe.mooring@veriphor.com>2021-06-20 22:30:41 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-29 21:20:38 +0300
commit34e4742f0caab0d3eb9efd00fce4157d112617b5 (patch)
tree090660331f25f6918189c0685a74bb5406b24ac9 /hugolib
parentbffa2a2a9821535898c2f1452cdc85c4f031b4f1 (diff)
Fix date format in schema and opengraph templates
Fixes #8671
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/embedded_templates_test.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/hugolib/embedded_templates_test.go b/hugolib/embedded_templates_test.go
index 5d7d6dc23..f0fc9cfde 100644
--- a/hugolib/embedded_templates_test.go
+++ b/hugolib/embedded_templates_test.go
@@ -31,12 +31,16 @@ images=["siteimg1.jpg", "siteimg2.jpg"]
b.WithContent("mybundle/index.md", `---
title: My Bundle
+date: 2021-02-26T18:02:00-01:00
+lastmod: 2021-05-22T19:25:00-01:00
---
`)
b.WithContent("mypage.md", `---
title: My Page
images: ["pageimg1.jpg", "pageimg2.jpg"]
+date: 2021-02-26T18:02:00+01:00
+lastmod: 2021-05-22T19:25:00+01:00
---
`)
@@ -62,16 +66,24 @@ title: My Site
<meta property="og:title" content="My Bundle" />
<meta property="og:url" content="https://example.org/mybundle/" />
<meta property="og:image" content="https://example.org/mybundle/featured-sunset.jpg"/>
+<meta property="article:published_time" content="2021-02-26T18:02:00-01:00" />
+<meta property="article:modified_time" content="2021-05-22T19:25:00-01:00" />
<meta itemprop="name" content="My Bundle">
<meta itemprop="image" content="https://example.org/mybundle/featured-sunset.jpg">
+<meta itemprop="datePublished" content="2021-02-26T18:02:00-01:00" />
+<meta itemprop="dateModified" content="2021-05-22T19:25:00-01:00" />
`)
b.AssertFileContent("public/mypage/index.html", `
<meta name="twitter:image" content="https://example.org/pageimg1.jpg"/>
<meta property="og:image" content="https://example.org/pageimg1.jpg" />
<meta property="og:image" content="https://example.org/pageimg2.jpg" />
+<meta property="article:published_time" content="2021-02-26T18:02:00+01:00" />
+<meta property="article:modified_time" content="2021-05-22T19:25:00+01:00" />
<meta itemprop="image" content="https://example.org/pageimg1.jpg">
-<meta itemprop="image" content="https://example.org/pageimg2.jpg">
+<meta itemprop="image" content="https://example.org/pageimg2.jpg">
+<meta itemprop="datePublished" content="2021-02-26T18:02:00+01:00" />
+<meta itemprop="dateModified" content="2021-05-22T19:25:00+01:00" />
`)
b.AssertFileContent("public/mysite/index.html", `
<meta name="twitter:image" content="https://example.org/siteimg1.jpg"/>