2.0.0 • Published 2 years ago
@ericytt/hexo-toc v2.0.0
hexo-toc
Insert a markdown TOC(Table Of Content) before posts be rendered.
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.
Install
npm install hexo-toc --save
Options
All the options of markdown-toc,
slugify function, and heading anchor options can be specified as follow in your _config.yml
:
toc:
maxdepth: 3
class: toc
slugify: transliteration
decodeEntities: false
maxdepth
: Use headings whose depth is at most maxdepth.class
: The CSS Class for the toc. (Default isfalse
)slugify
: Choose which slugify function you want to use. Currently support uslug (Default) and transliteration.decodeEntities
: Select whether to enable decode entities. ( Default isfalse
and please see #15).