Skip to content

Commit

Permalink
Modularizing index
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronTraas committed Apr 27, 2024
1 parent 9454d21 commit 085bd48
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _includes/site_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% assign sections = 'Recipes,Adult Beverages,Tobacco' | split: ',' %}
{% for section_name in sections %}
{% assign section_dir = section_name | replace: ' ', '%20' %}
<h2><a href="{{ section_dir | relative_url }}/">{{section_name}}</a></h2>
<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' %}
<!-- Untested: {{page.url}} -->
{% else %}
<li><a href="{{ page.url | relative_url }}">{{page.title}}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endfor %}

0 comments on commit 085bd48

Please sign in to comment.