Skip to content

Commit a9959af

Browse files
also allow (nested) subsections and subsubsections
1 parent 468ae4d commit a9959af

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

_includes/pagelist

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% if include.section != nill and include.section != "" %}
2-
{% assign section = include.section %}
2+
{% assign section = "/" | append: include.section | append: "/" %}
33
{% else %}
44
{% assign section = page.url %}
55
{% endif %}
@@ -9,16 +9,17 @@
99
{% for item in site.pages %}
1010
{% assign part1 = item.url | slice: 0, section.size %}
1111
{% if part1 == section %}
12-
{% assign part2 = item.url | slice: section.size, 999 | split: "/" %}
12+
{% assign part2 = item.url | slice: section.size, 999 | split: "/" %}
1313
{% if part2.size == 1 %}
1414
{% assign selected = selected | push: item %}
1515
{% endif %}
1616
{% endif %}
1717
{% endfor %}
1818

1919
<ul>
20-
{% assign selected = selected | sort_natural: "title" %}
21-
{% for item in selected %}
22-
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
20+
{% for item in selected | sort_natural: "title" %}
21+
{% if item.title != nill %}
22+
<li><a href="{{ item.url }}"> {{ item.title }}</a></li>
23+
{% endif %}
2324
{% endfor %}
2425
</ul>

0 commit comments

Comments
 (0)