Skip to content

Add disableKinds option #2534

@Jos512

Description

@Jos512

Hi,

I'm using hugo_0.17_Windows-64bit.zip. In my config.toml file I've disabled the generation of tag and category pages (my site doesn't need them) as follows:

[taxonomies]
  category = "" 
  tags = ""

This worked on Hugo 0.16 and earlier: no tag and category pages were generated, and no error appeared. With Hugo 0.17, however, I get the following error message:

PS I:\site> hugo server --buildDrafts
Started building sites ...
panic: Node with ID "taxlist--0" in use

goroutine 1 [running]:
panic(0xa19840, 0xc042370740)
        /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1af
github.com/spf13/hugo/hugolib.(*Site).getOrAddNode(0xc0420022c0, 0xc042370720, 0xa, 0x1, 0x2)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:2228 +0x79e
github.com/spf13/hugo/hugolib.(*Site).nodeLookup(0xc0420022c0, 0xc042370700, 0x8, 0x0, 0x1, 0xc042370700)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:2264 +0x165
github.com/spf13/hugo/hugolib.(*Site).renderListsOfTaxonomyTerms(0xc0420022c0, 0x1, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1882 +0x1ca
github.com/spf13/hugo/hugolib.(*HugoSites).preRender(0xc0420123c0, 0x101, 0x0, 0x101, 0x0, 0x1b)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/hugo_sites.go:419 +0xd1
github.com/spf13/hugo/hugolib.(*HugoSites).Build(0xc0420123c0, 0x101, 0x0, 0x1b, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/hugo_sites.go:225 +0x205
github.com/spf13/hugo/commands.buildSites(0x1, 0x0, 0xa)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:666 +0xf7
github.com/spf13/hugo/commands.build(0xc0424a3a9e, 0x1, 0x1, 0xc042332450, 0xc042332450)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:467 +0xa0
github.com/spf13/hugo/commands.server(0xe48d20, 0xc0422bdbf0, 0x0, 0x1, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/server.go:164 +0x4e6
github.com/spf13/hugo/vendor/github.com/spf13/cobra.(*Command).execute(0xe48d20, 0xc0422bdbd0, 0x1, 0x1, 0xe48d20, 0xc04
22bdbd0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/vendor/github.com/spf13/cobra/command.go:599 +0x23b
github.com/spf13/hugo/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xe475c0, 0xb63300, 0x40e514, 0xe503d0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/vendor/github.com/spf13/cobra/command.go:689 +0x36e
github.com/spf13/hugo/commands.Execute()
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:174 +0x74
main.main()
        /Users/spf13/gopath/src/github.com/spf13/hugo/main.go:26 +0x39

If I change my config.toml file to:

[taxonomies]
  category = "categories" 
  tags = "tags"

Then Hugo 0.17 generates my site fine:

PS I:\site> hugo server --buildDrafts
Started building sites ...
Built site for language en:
10 of 10 drafts rendered
0 future content
0 expired content
18 pages created
0 non-page files copied
0 paginator pages created
4 categories created
0 tags created
total in 90 ms
Watching for changes in I:\site\{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Can I still disable tags and category pages in Hugo 0.17? I'd really like to because I use Hugo not as a blog, and so have no need for tag/category pages.

Thanks,

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions