December 29, 2022, 11:33pm
I want to disable HTML outputs for kind
pages. But I want to enable it for kind
However I see that Hugo generates html files for kind
pages even after setting
disableKinds = ['page'] in
I also observed that Hugo generates the following files on it’s own. I have neither provided any sitemap templates nor configured my site for taxonomy (in my
Link to repo:
To run the site after cloning you need to use:
cd exampleSite; hugo server --cleanDestinationDir --themesDir ../../ -t hugo-theme-console
PS: My work is a fork of hugo-theme-console
Move this to the root table. It is currently in the
To disable the others:
disableKinds = ['RSS','sitemap','taxonomy','term']
December 30, 2022, 3:59am
@jmooring . Thanks a lot for the answer. That worked like a charm.
But for the sake of clarity, I have a question.
Why Hugo generates many things (sitemaps,/tags/,/categories/) on its own? Then we have to disable the automatic generation using
Should it not be other way round? Hugo should not generate all these on its own. We should specify what we want Hugo to generate.
categories taxonomies are enabled by default, making it easier for a new user to get started. All they have to do is add a
categories array to front matter and it just… works.
Most people want a sitemap, and by enabling it by default they don’t have to think about it. It just… works. Same with RSS.
And theme authors rely on these defaults.
We spend a lot of time and energy to make sure that the defaults are sensible, but they will never be right for everyone.
December 30, 2022, 4:40am
Thanks for the explanation
I understand that.
So, I set
disableKinds = ['pages','RSS','sitemap','taxonomy','term'] in the root table.
But that leads to a problem. Looks like the section list pages don’t have access to the markdown files now.
Here is what I mean:
The list page works as expected.
The csv output format (at section level) works as expected.
The single pages are generated as expected.
The list page shows nothing.
The csv file shows nothing.
The page html pages are not generated as expected.
Here is a
screenshot of the 6 things I mentioned above.
I did not want the CSV and HTML list pages to go blank.
I want to suppress the generation of single page HTML pages
Is there a way to achieve these ?
And keep in mind you can “cascade” the build options from your site configuration.
disableKinds = ['RSS', 'sitemap', 'taxonomy', 'term']
list = 'local'
render = 'never'
publishResources = 'false'
kind = 'page'
path = '/posts/**'
December 30, 2022, 10:04pm
I’m not sure this will add anything of importance to that thread, but by reading the title, it seems what you wanted to do was to disable specifically the
html output formats, and maybe you still wanted the
RSS or json etc… In which case you should look at the
This can be set in the Front Matter, so also available with cascade.