Skip to content

Commit

Permalink
Add a list (similar to home) to pages that have subpages (part1)
Browse files Browse the repository at this point in the history
The events.md can be used as a template for the remaining pages, where
the subpages are not implemented yet.
  • Loading branch information
StefanBrand committed Jan 3, 2018
1 parent 2aa2e9e commit 1936e59
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,23 @@ <h1 class="post-title">{% translate page.title %}</h1>
{% endfor %}
</div>
{% endif %}

{% if page.subpages %}
<ul class="page-list">
{% for pageobj in site.pages %}
{% if page.subpages contains pageobj.path %}
<li class="page-list-item">
<h2>
<a class="page-link" href="{{ page.url | relative_url }}">
{% translate pageobj.title %}
</a>
</h2>
<div class="page-content">
{{ pageobj.content }}
</div>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</article>
1 change: 1 addition & 0 deletions pages/events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: page
title: pages.events.title
subpages: [pages/events/local-events.md, pages/events/event-materials.md, pages/events/event-guide.md, pages/events/efct.md]
---

{% translate_file events.md %}

0 comments on commit 1936e59

Please sign in to comment.