Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / docs / _includes / navigation.html
blob0381fcfaa9b0b635912a05c57a7b5d710cb96714
1 <!-- modifed from https://gist.github.com/kasperisager/9416313 -->
2 {% capture html %}
3 <ul class="nav-tree">
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 %}
11 <li>
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 }}
20 {% endif %}
21 {% include navigation.html context=entry.url %}
22 </li>
23 {% endif %}
24 {% endunless %}
25 {% endfor %}
26 {% if include.context == "/" %}
27 </ul>
28 </li>
29 {% endif %}
30 </ul>
31 {% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' | remove: '<ul class="nav-tree"></ul>'}}