Hugo creates two directories—tags
and categories
—with index.html
and index.xml
in them. Could someone please tell me how I can avoid these directories?
Hi,
tags
and categories
are taxonomies. You can disable these by setting disableKinds
in your config.toml as described in the docs here: https://gohugo.io/content-management/taxonomies#default-taxonomies
Still generates the
categories/index.html
and tags/index.html
pages!
Works for me
Please show your code so that we can try and help.
Should have done it earlier. Sorry. Here’s the contents of config.toml
title = "Testing"
[params]
description = """Learning Hugo"""
favicon = "favicon.ico"
languageCode = "en-us"
DefaultContentLanguage = "en"
disableKinds = ["taxonomy", "taxonomyTerm"]
[blackfriday]
plainIDAnchors = true
hrefTargetBlank = true
noreferrerLinks = true
You need to move these above the [params]
block.
Edited to add:
Technically, you only need to move disableKinds
to above the [params]
block to fix your current issue, but the other two keys are top-level keys as well (i.e., should not be under [params]
).
2 Likes
Works! Thanks so much!