Table of contents using Jekyll and Kramdown

后端 未结 2 528
星月不相逢
星月不相逢 2021-02-07 11:02

I\'m trying to use Kramdown\'s auto \"Table of Contents\" generator on a page (not a post) on my Jekyll site.

_includes/toc.html

2条回答
  •  执念已碎
    2021-02-07 11:53

    I wanted to do something similar but was trying to avoid having any kind of markup in my post page, similar to your {% include toc.html %}.

    I found this great Ruby Gem - jekyll-toc that allows you to place a TOC anywhere in a layout file. You enable it in the front matter.

提交回复
热议问题