getnikola / nikola

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

Easy way to access `CATEGORY_TITLES`/`CATEGORY_DESCRIPTIONS` from `tags.tmpl` #3584

Closed Kwpolska closed 3 years ago

Kwpolska commented 3 years ago

Discussed in https://github.com/getnikola/nikola/discussions/3583

Originally posted by **kai-tub** November 5, 2021 Hi :) Thank you again for providing such a nice static site generator! I am working on customizing my personal theme and the current goal is to have a _category-based_ landing page. With `CATEGORY_TITLES`/`CATEGORY_DESCRIPTIONS` I can update the category information into a _prettier_ version. These variables are then used when the category (index) page itself is rendered. Now I would like to be able to _re-use_ the information in the `tags.tmpl` page such that I can use the _pretty_ category name as a link with the description to provide extra information. The category name and description would then be combined into a _card_ with an optional image for easier navigation. Is there an easy way to accomplish this? Or am I too stuck on the `tags.tmpl` and should just create a different template and try to use that?