Table of contents using Jekyll and Kramdown

后端 未结 2 531
星月不相逢
星月不相逢 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:48

    {:toc} is kramdown tag for automatic Table of content generation.

    In your case, you need two more things to make it work :

    1. Allow kramdown to parse inside html blocks : in _config.yml add :

      kramdown:
        parse_block_html: true
      
    2. in _includes/toc.html, you need to provide a seed list :

      
      

提交回复
热议问题