summaryrefslogtreecommitdiffstats
path: root/testscripts
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-19 09:55:08 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-19 11:37:05 +0200
commitd6197a41fa057cb98da1c3ed0e41c2aef38f2600 (patch)
treef076faf4135a0f5cb65baf8a0e8d09e4228ffa8a /testscripts
parente4e0313c80a456cedcd35f716a71667f035498bf (diff)
Re-add --printUnusedTemplates and --printPathWarnings
And now with tests. Updates #10953
Diffstat (limited to 'testscripts')
-rw-r--r--testscripts/commands/hugo_printpathwarnings.txt17
-rw-r--r--testscripts/commands/hugo_printunusedtemplates.txt11
2 files changed, 28 insertions, 0 deletions
diff --git a/testscripts/commands/hugo_printpathwarnings.txt b/testscripts/commands/hugo_printpathwarnings.txt
new file mode 100644
index 000000000..f4c76ebab
--- /dev/null
+++ b/testscripts/commands/hugo_printpathwarnings.txt
@@ -0,0 +1,17 @@
+hugo --printPathWarnings
+
+stdout 'Duplicate target paths: .index.html \(2\)'
+
+-- hugo.toml --
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "404", "section"]
+baseURL = "https://example.org/"
+-- layouts/_default/single.html --
+Single.
+-- layouts/index.html --
+Home.
+-- content/p1.md --
+---
+title: "P1"
+url: "/"
+---
+
diff --git a/testscripts/commands/hugo_printunusedtemplates.txt b/testscripts/commands/hugo_printunusedtemplates.txt
new file mode 100644
index 000000000..312e4920d
--- /dev/null
+++ b/testscripts/commands/hugo_printunusedtemplates.txt
@@ -0,0 +1,11 @@
+hugo --printUnusedTemplates
+
+stdout 'Template _default/list.html is unused'
+
+-- hugo.toml --
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "404", "section", "page"]
+baseURL = "https://example.org/"
+-- layouts/index.html --
+Home.
+-- layouts/_default/list.html --
+{{ errorf "unused template: %s" .Kind }}