diff options
Diffstat (limited to 'commands/hugo.go')
-rw-r--r-- | commands/hugo.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/commands/hugo.go b/commands/hugo.go index ce3c4ab7b..8c5294f00 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -31,6 +31,7 @@ import ( "time" "github.com/gohugoio/hugo/hugofs/files" + "github.com/gohugoio/hugo/tpl" "github.com/gohugoio/hugo/common/types" @@ -217,6 +218,7 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) { "force", "gc", "printI18nWarnings", + "printUnusedTemplates", "invalidateCDN", "layoutDir", "logFile", @@ -501,7 +503,6 @@ func (c *commandeer) build() error { return err } - // TODO(bep) Feedback? if !c.h.quiet { fmt.Println() c.hugo().PrintProcessingStats(os.Stdout) @@ -513,6 +514,11 @@ func (c *commandeer) build() error { c.logger.Warnln("Duplicate target paths:", dupes) } } + + unusedTemplates := c.hugo().Tmpl().(tpl.UnusedTemplatesProvider).UnusedTemplates() + for _, unusedTemplate := range unusedTemplates { + c.logger.Warnf("Template %s is unused, source file %s", unusedTemplate.Name(), unusedTemplate.Filename()) + } } if c.h.buildWatch { |