1 <!-- modifed from https://gist.github.com/kasperisager/9416313 -->
4 {% assign entries = site.pages | sort:
"path" %}
5 {% for entry in entries %}
6 {% unless entry.tags contains 'no_toc' %}
7 {% capture slug %}{{ entry.url | split:
"/" | last }}{% endcapture %}
8 {% capture current %}{{ entry.url | remove: slug | replace:
"//",
"/" }}{% endcapture %}
9 {% if current==entry.url %} {% assign current =
"_ROOT" %} {% endif %}
10 {% if current == include.context %}
12 {% if page.url == entry.url %}
<strong>{% elsif page.url contains entry.url %}
<em>{% endif %}
13 <a href=
"{{ site.baseurl }}{{ entry.url }}">{{ entry.title }}
</a>
14 {% if page.url == entry.url %}
</strong>{% elsif page.url contains entry.url %}
</em>{% endif %}
15 {% assign ccon = entry.content | stringify%}
16 {% if ccon contains '
<!-- TOC-START -->' %}
17 {% assign toc = ccon | split: '
<!-- TOC-END -->' | first | split: '
<!-- TOC-START -->' | last %}
18 {% assign link_prefix = '
href=
"' | append: site.baseurl | append: entry.url | append: "#
" %}
19 {{toc | replace: 'href="#', link_prefix }}
21 {% include navigation.html context=entry.url %}
26 {% if include.context ==
"/" %}
31 {% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' | remove: '
<ul class=
"nav-tree"></ul>'}}