Replies: 1 comment 4 replies
-
The plugin youβre referring to is an extension for Python-Markdown, not Nikola. Nikola does not do anything resembling tables of contents.
You can have anything you want as a metadata field. If you want something that is not a string, it may explode, but it is unlikely to. Worst case, you can render HTML into the metadata field, and then just render it on the page without formatting.
Pages are posts too. The remaining things like indexes probably donβt need sidebars. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know that there is a table of contents plugin (e.g. as discussed at https://stackoverflow.com/questions/64554646) that can add an auto-generated table of contents to the rendered body of a post, which is then inserted into the page template.
This isn't what I want.
I have a somewhat customized page template that implements a sidebar (site live at https://zahlman.github.io) and I want to put a table of contents for each blog post in the sidebar.
I have a
sidebarblock in my theme'sbase_helper.tmpland my idea is to get some value into thepostobject which could hold the table-of-contents HTML fragment (some nest of<ol>elements), and insert that into the template. So I thought I could define a metadata plugin that generates this when the Markdown is parsed, and export it for the template to use. But there doesn't seem to be an appropriate metadata field for this. (And, of course, the data has to come from somewhere else for a non-post page, or at least the missing data has to be handled...)Is there some other intended way to make this work?
Beta Was this translation helpful? Give feedback.
All reactions