The index page on my Jekyll site is meant to be exactly like a post with only one extra bit of code for navigating the other posts. I'm not really using it to generate a blog per se, but a bunch of press pages.
Now within each post I am using kramdown to generate a table of contents like so:
* This line is a placeholder to generate the table of contents
{:toc}
That works fine for all the posts, but when I try to use it on anything but a post, it doesn't generate. The output is simply empty. It doesn't show the raw kramdown above or anything, it just disappears and nothing (especially not a TOC) appears in it's place.
Some of the comments on this post: How to create a table of contents to Jekyll blog post?
Suggest putting a <li>
before the above code, but I tried every possible iteration of that and it didn't work. Another comment suggested something with an <h1>
tag is necessary, which exists.
I realize there's a plugin to generate a table of contents, the non-javascript version is older than the implementation of TOC using kramdown from what I've seen (that plugin is here: https://github.com/dafi/jekyll-toc-generator ).
And the other plugin ( https://github.com/ghiculescu/jekyll-table-of-contents ) is a bit more recent, but I would prefer not to use javascript to do what kramdown already can do.
Is it possible to use the standard kramdown table of contents markdown to generate one in my case on a page instead of a post?