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:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-13 19:58:06 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-13 21:01:43 +0300
commit701486728e21bc0c6c78c2a8edb988abdf6116c7 (patch)
treea3073c654f62a1564470f6a6f3d5342fbe8e392c /hugolib/page_test.go
parentf2795d4d2cef30170af43327f3ff7114923833b1 (diff)
hugolib: Fix dates for sections with dates in front matter
Fixes #5854
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index a3b86ef2a..91ccb0d3e 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -507,6 +507,14 @@ title: No Date
`)
+ // https://github.com/gohugoio/hugo/issues/5854
+ b.WithSimpleConfigFile().WithContent("with-index-date/_index.md", `---
+title: Date
+date: 2018-01-15
+---
+
+`)
+
b.CreateSites().Build(BuildCfg{})
assert.Equal(1, len(b.H.Sites))
@@ -515,6 +523,7 @@ title: No Date
assert.Equal(2017, s.getPage("/").Date().Year())
assert.Equal(2017, s.getPage("/no-index").Date().Year())
assert.True(s.getPage("/with-index-no-date").Date().IsZero())
+ assert.Equal(2018, s.getPage("/with-index-date").Date().Year())
}