getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.62k stars 451 forks source link

POST_SECTIONS_ARE_INDEXES option? #3596

Closed loup-brun closed 2 years ago

loup-brun commented 2 years ago

Environment

Python Version: Python 3.8.8

Nikola Version: Nikola v8.2.0

Operating System: macOS 10.13.6

Description:

There is the mention of POST_SECTIONS_ARE_INDEXES in the documentation (see Theming) but apparently has no effect, a search in the codebase returns no occurrences. Can such option be replicated? I have a collection of posts, say events/*.md which I reference in conf.py:


POSTS = (
    ("events/*.md", "events", "event.tmpl"),

    # ...
)

I want to automatically enable indexes for such sections, as Nikola currently just does default a directory listing of the section (“Index of /events”) with no templating/styling applied.

Kwpolska commented 2 years ago

This documentation seems outdated and is mentioning a feature removed in Nikola v8.0.0. This setup should be able to get what you want in recent versions;

CATEGORY_PATH = ""
CATEGORY_PREFIX = ""
CATEGORIES_INDEX_PATH = "categories.html"
CATEGORY_ALLOW_HIERARCHIES = True
CATEGORY_DESTPATH_AS_DEFAULT = True
CATEGORY_PAGES_ARE_INDEXES = True
Kwpolska commented 2 years ago

I removed the outdated docs mentions from theming.rst and template-variables.rst.

loup-brun commented 2 years ago

Thank you!