aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_stats_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site_stats_test.go')
-rw-r--r--hugolib/site_stats_test.go35
1 files changed, 34 insertions, 1 deletions
diff --git a/hugolib/site_stats_test.go b/hugolib/site_stats_test.go
index 4ed6411d2..167194ef5 100644
--- a/hugolib/site_stats_test.go
+++ b/hugolib/site_stats_test.go
@@ -94,5 +94,38 @@ aliases: [/Ali%d]
helpers.ProcessingStatsTable(&buff, stats...)
- c.Assert(buff.String(), qt.Contains, "Pages | 19 | 6")
+ c.Assert(buff.String(), qt.Contains, "Pages | 21 | 7")
+}
+
+func TestSiteLastmod(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+baseURL = "https://example.com/"
+-- content/_index.md --
+---
+date: 2023-01-01
+---
+-- content/posts/_index.md --
+---
+date: 2023-02-01
+---
+-- content/posts/post-1.md --
+---
+date: 2023-03-01
+---
+-- content/posts/post-2.md --
+---
+date: 2023-04-01
+---
+-- layouts/index.html --
+site.Lastmod: {{ .Site.Lastmod.Format "2006-01-02" }}
+site.LastChange: {{ .Site.LastChange.Format "2006-01-02" }}
+home.Lastmod: {{ site.Home.Lastmod.Format "2006-01-02" }}
+
+`
+ b := Test(t, files)
+
+ b.AssertFileContent("public/index.html", "site.Lastmod: 2023-04-01\nsite.LastChange: 2023-04-01\nhome.Lastmod: 2023-01-01")
}