From d6197a41fa057cb98da1c3ed0e41c2aef38f2600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 19 May 2023 09:55:08 +0200 Subject: Re-add --printUnusedTemplates and --printPathWarnings And now with tests. Updates #10953 --- testscripts/commands/hugo_printpathwarnings.txt | 17 +++++++++++++++++ testscripts/commands/hugo_printunusedtemplates.txt | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 testscripts/commands/hugo_printpathwarnings.txt create mode 100644 testscripts/commands/hugo_printunusedtemplates.txt (limited to 'testscripts') 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 }} -- cgit v1.2.3