TOC
This article introduce two ways that adding TOC for markdown files.
- doctoc
- Hexo TOC
doctoc
Command line
|
|
It will add a TOC at the begining of your markdown files in all sub-folder.
Hexo TOC
Hexo will generate TOC automatically by modify two files as below.
Let’s take the default theme landscape
for example.
Theme layout
file path:/themes/landscape/layout/_partial/article.ejs
Add the following code before line <%- post.content %>
|
|
CSS file
To avoid duplicateed prefixing indexs problem as below we need to disable the CSS list style.
|
|
file path:theme/landscape/source/css/_extend.styl
Change list-style: decimal
to list-style: none