-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathdirindex.html
39 lines (37 loc) · 1.07 KB
/
dirindex.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
layout: default
hide_subdirindex: true
---
<div class="dirindex">
<h2>
{% if page.title %}
{{ page.title }}
{% else %}
{{ page.url | remove_first:'/index.html' | remove_first:'/' | replace:'/',' — ' | capitalize }}
{% endif %}
</h2>
{% if content != '' %}
<p class="preamble">
{{ content }}
</p>
{% endif %}
{% capture url_prefix %}{{ page.url | remove_first:'index.html' }}{% endcapture %}
{% capture key_prefix %}:{{url_prefix}}{% endcapture %}
<ul class="pages">
{% for subpage in site.pages %}
{% capture subpage_key %}:{{ subpage.url }}{% endcapture %}
{% if subpage_key contains key_prefix and subpage.url != page.url %}
{% if page.hide_subdirindex != true or subpage.title %}
<li>
<a href="{{ subpage.url | remove_first:'index.html' }}">
{% if subpage.title %}
{{ subpage.title }}
{% else %}
{{ subpage.url | remove_first:url_prefix | remove_first:'index.html' }}
{% endif %}</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</div>