Mil*_*o S 3 jekyll github-pages
尝试使用纯粹托管的“开箱即用” GitHub Pages Jekyll建立博客/文档;我专门试图避免必须在本地运行Jekyll(尽管可以)。
我已经尝试了http://www.seanbuscay.com/blog/jekyll-toc-markdown/,但是这不起作用。
这是可能的,还是确实需要其他工具?
默认情况下,Jekyll使用Kramdown,它已经带有TOC生成器。您不需要为此的插件,因此它将与github-pages一起使用。
kramdown支持具有ID集的所有标头的目录的自动生成。只需使用IAL将参考名称“ toc”分配给有序列表或无序列表,该列表将被实际的目录替换,如果将“ toc”应用于无序列表则将其呈现为嵌套无序列表有序列表。应用于原始列表的所有属性也将应用于生成的TOC列表,如果未设置ID,则它将获得markdown-toc的ID。
# Contents
{:.no_toc}
* Will be replaced with the ToC, excluding the "Contents" header
{:toc}
# H1 header
## H2 header
Run Code Online (Sandbox Code Playgroud)
那会给你:
<h1 class="no_toc" id="contents">Contents</h1>
<ul id="markdown-toc">
<li><a href="#h1-header" id="markdown-toc-h1-header">H1 header</a> <ul>
<li><a href="#h2-header" id="markdown-toc-h2-header">H2 header</a></li>
</ul>
</li>
</ul>
<h1 id="h1-header">H1 header</h1>
<h2 id="h2-header">H2 header</h2>
Run Code Online (Sandbox Code Playgroud)
https://kramdown.gettalong.org/converter/html.html#toc