mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 07:00:31 +03:00
Re-add --printUnusedTemplates and --printPathWarnings
And now with tests. Updates #10953
This commit is contained in:
parent
e4e0313c80
commit
d6197a41fa
4 changed files with 59 additions and 7 deletions
17
testscripts/commands/hugo_printpathwarnings.txt
Normal file
17
testscripts/commands/hugo_printpathwarnings.txt
Normal file
|
@ -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: "/"
|
||||
---
|
||||
|
11
testscripts/commands/hugo_printunusedtemplates.txt
Normal file
11
testscripts/commands/hugo_printunusedtemplates.txt
Normal file
|
@ -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 }}
|
Loading…
Add table
Add a link
Reference in a new issue