Skip to content

Commit

Permalink
made header menu dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-dolf committed May 30, 2022
1 parent 7286192 commit 3dc2ec8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
34 changes: 4 additions & 30 deletions _data/menu-header.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
- title: About Us
pages:
- page: Mission & History
link: /about-us/mission-and-history
- page: Our Impact
link: /about-us/our-impact
- page: Our Partners
link: /about-us/our-partners
folder: about-us

- title: Our Work
pages:
- page: Policy & Advocacy
link: /our-work/policy-and-advocacy
- page: Reentry Support
link: /our-work/reentry-support
- page: Business Advising
link: /our-work/business-advising
- page: Community Education
link: /our-work/community-education
folder: our-work

- title: Services
pages:
- page: Clear Your Record
link: /services/clear-your-record
- page: Know Your Rights
link: /services/know-your-rights
folder: services

- title: Get Involved
pages:
- page: Stay Informed
link: /get-involved/stay-informed
- page: Donate
link: /get-involved/donate
- page: Volunteer
link: /get-involved/volunteer
- page: Membership
link: /get-involved/membership
folder: get-involved
6 changes: 4 additions & 2 deletions _includes/menus/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
<div class="bar"></div>
</button>
<ul class="list sub-list">
{% for sub-item in item.pages %}
<li><a class="menu-link" href="{{ sub-item.link | relative_url }}">{{ sub-item.page }}</a></li>
{% for page in site.pages %}
{% if page.url contains item.folder %}
<li><a class="menu-link" href="{{ page.url | relative_url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
Expand Down
1 change: 1 addition & 0 deletions pages/services/testing-new-pages-in-forestry.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ title: Testing new pages in forestry
sections: []

---
{% include menus/dynamic.html %}

0 comments on commit 3dc2ec8

Please sign in to comment.