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