getnikola / nikola

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

POSTS_SECTIONS_ARE_INDEXES KeyError on site init #3665

Closed madduck closed 1 year ago

madduck commented 1 year ago

I am using current master f9a7043ad and trying to initialise a site, I get:

% nikola init .
Traceback (most recent call last):
  File "/home/madduck/.bin/nikola", line 11, in <module>
    load_entry_point('Nikola==8.2.3', 'console_scripts', 'nikola')()
  File "/home/madduck/code/nikola/ve/lib/python3.9/site-packages/nikola/__main__.py", line 166, in main
    _ = DN.run(oargs)
  File "/home/madduck/code/nikola/ve/lib/python3.9/site-packages/nikola/__main__.py", line 354, in run
    self.nikola.init_plugins()
  File "/home/madduck/code/nikola/ve/lib/python3.9/site-packages/nikola/nikola.py", line 1142, in init_plugins
    self._activate_plugins_of_category("Taxonomy")
  File "/home/madduck/code/nikola/ve/lib/python3.9/site-packages/nikola/nikola.py", line 1334, in _activate_plugins_of_category
    plugin_info.plugin_object.set_site(self)
  File "/home/madduck/code/nikola/ve/lib/python3.9/site-packages/nikola/plugins/task/sections.py", line 71, in set_site
    self.show_list_as_index = site.config["POSTS_SECTIONS_ARE_INDEXES"]
KeyError: 'POSTS_SECTIONS_ARE_INDEXES'

I feel a bit silly reporting this as I would have assumed this problem must have been encountered before, but I cannot find anything…

The same problem exists with the code at tag v8.2.3

Environment

Python Version: 3.9.2

Nikola Version: master f9a7043ad

Operating System: Debian stable

madduck commented 1 year ago

Just trying to debug this myself, and I have no idea where plugins/task/sections.py even comes from. Sorry if I am being thick…

madduck commented 1 year ago

grep -r sections yields no code in the source code, nor is there a file sections.py in the tree, but I've just removed the virtualenv and confirmed that the file was recreated upon running setup.py install. It's a ghost file!

madduck commented 1 year ago

Argh, I am sorry, that file was left over in the build directory from a build in 2017 it seems.

Kwpolska commented 1 year ago

The sections feature was killed (merged with categories) a long time ago.

As for the packaging issues, consider using pip (which can also be run inside a project directory: pip install . or in develop/editable mode: pip install -e .) instead of running setup.py directly (which is deprecated.)