Insert a markdown TOC(Table Of Content) before posts be rendered.
Unlike the native toc
helper, this plugin will inject a TOC only when a placeholder(<!-- toc -->
) found in the raw markdown files. And the TOC will be injected after the placeholder.
All you need to do is placing a placeholder(<!-- toc -->
) in your post when and where needed.
Note: this plugin will not mangle your posts(markdown files), so you can use it bold.
npm install hexo-toc --save
All the options of markdown-toc,
can be specified as follow in you _config.yml
:
toc:
maxdepth: 3
- maxdepth: Use headings whose depth is at most maxdepth.
Working with hexo-renderer-markdown-it.
# Markdown-it config
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
render:
html: true
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.