Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force Pelican to suppress generation of category files?

Tags:

pelican

I don't want Pelican 3.6 to generate:

/author/
/category/
/tag/
/archives.html
/authors.html
/categories.html
/tags.html

DIRECT_TEMPLATES can be set to suppress some of the index files:-

# DIRECT_TEMPLATES = ['index', 'categories', 'authors', 'archives']
DIRECT_TEMPLATES = ['index']

Omitting tag metadata in source content files will prevent generation of the tag folder and index; omitting author metadata and the AUTHOR setting will prevent generation of the author folder and index.

But it seems that suppressing category isn't so simple. I've tried setting DEFAULT_CATEGORY to an empty string, but this results in errors and no output for sources with no category metadata:-

Skipping <some_file>: could not find information about 'NameError: category'

I've also tried removing the relevant template files from the theme being used, but this merely causes them to be replaced with the matching template in the built-in "simple" theme.

Am I missing an established method of suppressing category generation?

like image 347
jah Avatar asked Feb 09 '23 09:02

jah


1 Answers

The URL settings documentation has a long list of settings, including several […]_SAVE_AS settings. Directly below the URL settings table is a note that answers your question: for any page type that you do not want generated, set the corresponding […]_SAVE_AS setting to ''. For example, to suppress individual category page generation, add this setting:

CATEGORY_SAVE_AS = ''
like image 69
Justin Mayer Avatar answered Feb 11 '23 21:02

Justin Mayer