mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-04-25 04:45:37 +08:00
Make the table of contents in the docs stay visible
This commit is contained in:
@@ -38,34 +38,36 @@ layout: default
|
||||
</p>
|
||||
</div>
|
||||
<div id="toc" class="col-md-3 py-6">
|
||||
{% for section in site.data.toc %}
|
||||
<h2 class="alt-h4">{{ section[0] }}</h2>
|
||||
<div class="toc-wrap">
|
||||
{% for section in site.data.toc %}
|
||||
<h2 class="alt-h4">{{ section[0] }}</h2>
|
||||
|
||||
<ul class="mt-2 mb-4 list-style-none">
|
||||
{% for item in section[1] %}
|
||||
<li>
|
||||
{% if item.url %}
|
||||
{% assign link = item %}
|
||||
{% else %}
|
||||
{% for doc in site.pages %}
|
||||
{% if doc.path == item %}
|
||||
{% assign link = doc %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<ul class="mt-2 mb-4 list-style-none">
|
||||
{% for item in section[1] %}
|
||||
<li>
|
||||
{% if item.url %}
|
||||
{% assign link = item %}
|
||||
{% else %}
|
||||
{% for doc in site.pages %}
|
||||
{% if doc.path == item %}
|
||||
{% assign link = doc %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.url == link.url %}
|
||||
{% assign classes = "text-brand-red" %}
|
||||
{% else %}
|
||||
{% assign classes = "text-gray-light" %}
|
||||
{% endif %}
|
||||
{% if page.url == link.url %}
|
||||
{% assign classes = "text-brand-red" %}
|
||||
{% else %}
|
||||
{% assign classes = "text-gray-light" %}
|
||||
{% endif %}
|
||||
|
||||
<a class="d-block no-underline py-1 {{classes}}" href="{{ link.url }}">{{ link.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
<a class="d-block no-underline py-1 {{classes}}" href="{{ link.url }}">{{ link.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user