Added active button to nav

This commit is contained in:
Joyce Chen
2020-04-12 03:47:19 -04:00
parent dedf05cb47
commit dccb3f7c94
3 changed files with 25 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
# Persona 5 Negotiation Guide # Persona 5 & Royal Negotiation Guide
A tool to help with negotiations in Persona 5. A tool to help with negotiations in Persona 5 and Persona 5 Royal.
(Incomplete. Work-in-progress.) (Incomplete. Work-in-progress.)

11
_data/navigation.yml Normal file
View File

@@ -0,0 +1,11 @@
- text: Info
url: /persona5-negotiation/info
- text: Shadows
url: /persona5-negotiation/shadows
- text: P5 Questions
url: /persona5-negotiation/
- text: Royal
url: /persona5-negotiation/royal

View File

@@ -1,6 +1,16 @@
<nav> <nav>
<a role="button" class="btn btn-outline-danger btn" href="info">Info</a> {% for navigation in site.data.navigation %}
{% assign link = navigation.url %}
{% if navigation.url != '/persona5-negotiation/' %}
{% assign link = navigation.url | append: '.html' %}
{% endif %}
{% assign current = '/persona5-negotiation' | append: page.url %}
<a role="button" class="btn btn-outline-danger btn{% if link == current %} active{% endif %}"
href="{{ navigation.url }}">{{ navigation.text }}</a>
{% endfor %}
<!-- <a role="button" class="btn btn-outline-danger btn" href="info">Info</a>
<a role="button" class="btn btn-outline-danger btn" href="shadows">Shadows</a> <a role="button" class="btn btn-outline-danger btn" href="shadows">Shadows</a>
<a role="button" class="btn btn-outline-danger btn" href="/persona5-negotiation">P5 Questions</a> <a role="button" class="btn btn-outline-danger btn" href="/persona5-negotiation">P5 Questions</a>
<a role="button" class="btn btn-outline-danger btn" href="royal">Royal</a> <a role="button" class="btn btn-outline-danger btn" href="royal">Royal</a> -->
</nav> </nav>