Skip to content

Commit

Permalink
Figure out current section
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronTraas committed Apr 27, 2024
1 parent df9d85b commit d276f25
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions _includes/site_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@

{% for section_name in sections -%}
{% assign section_dir = section_name | replace: ' ', '%20' -%}
{% if secions.size > 1 -%}
<h2>
{% if section_name == current_section %}
<a href="{{ section_dir | relative_url }}/">{{section_name}}</a>
{% endif -%}
</h2>
{% if sections.size > 1 -%}
<h2><a href="{{ section_dir | relative_url }}/">{{section_name}}</a></h2>
{% endif -%}
{% if section_name == current_section %}
<ul>
{% for page in site.pages | sort: 'title' -%}
{% assign segments = page.dir | remove_first: '/' | split: '/' -%}
{% assign section = segments | first -%}
{% if section == section_dir %}
{% if segments contains 'Untested' -%}
{% for page in site.pages | sort: 'title' -%}
{% assign segments = page.dir | remove_first: '/' | split: '/' -%}
{% assign section = segments | first -%}
{% if section == section_dir %}
{% if segments contains 'Untested' -%}
<!-- Untested: {{page.url}} -->
{% else -%}
{% else -%}
<li><a href="{{ page.url | relative_url }}">{{page.title}}</a></li>
{% endif -%}
{% endif -%}
{% endif -%}
{% endfor -%}
{% endfor -%}
</ul>
{% endif -%}
{% endfor -%}

0 comments on commit d276f25

Please sign in to comment.