Set shrine home link on the global navbar template

This commit is contained in:
Helen Chong 2024-07-07 13:00:45 +08:00
parent dc956fb995
commit 296a902f1e
4 changed files with 17 additions and 15 deletions

View File

@ -1,12 +1,11 @@
---
shrineHomeUrl: /shrines/asummersend/
---
{% extends "global/navbar.njk" %}
{% block navbarLinks %}
{% set shrineHomeUrl %}/shrines/asummersend/{% endset %}
{% set navPages = collections.all | eleventyNavigation("A Summers End Shrine") %}
{% set currentUrl %}{{ page.url }}{% endset %}
<li>
<a {% if currentUrl === shrineHomeUrl %}aria-current="page"{% endif %} href="{{ shrineHomeUrl }}">Shrine Home</a>
</li>
{%- for entry in navPages %}
<li>
<a {% if entry.url == page.url %}aria-current="page"{% endif %} href="{{ entry.url }}">{{ entry.title }}</a>

View File

@ -1,12 +1,11 @@
---
shrineHomeUrl: /shrines/cassettebeasts/
---
{% extends "global/navbar.njk" %}
{% block navbarLinks %}
{% set shrineHomeUrl %}/shrines/cassettebeasts/{% endset %}
{% set navPages = collections.all | eleventyNavigation("Cassette Beasts Shrine") %}
{% set currentUrl %}{{ page.url }}{% endset %}
<li>
<a {% if currentUrl === shrineHomeUrl %}aria-current="page"{% endif %} href="{{ shrineHomeUrl }}">Shrine Home</a>
</li>
{%- for entry in navPages %}
<li>
<a {% if entry.url == page.url %}aria-current="page"{% endif %} href="{{ entry.url }}">{{ entry.title }}</a>

View File

@ -2,6 +2,11 @@
https://kalechips.net/projects/snippets/burger #}
{% set navLinksEl %}
{%- if tags and tags.includes("shrine pages") %}
<li>
<a {% if currentUrl === shrineHomeUrl %}aria-current="page"{% endif %} href="{{ shrineHomeUrl }}">Shrine Home</a>
</li>
{%- endif -%}
{% block navbarLinks %}{% endblock %}
{%- if tags and tags.includes("shrine pages") %}
<li><a href="/shrines/">Shrine Directory</a></li>

View File

@ -1,12 +1,11 @@
---
shrineHomeUrl: /shrines/starwarskotor/
---
{% extends "global/navbar.njk" %}
{% block navbarLinks %}
{% set shrineHomeUrl %}/shrines/starwarskotor/{% endset %}
{% set navPages = collections.all | eleventyNavigation("KotOR Shrine") %}
{% set currentUrl %}{{ page.url }}{% endset %}
<li>
<a {% if currentUrl === shrineHomeUrl %}aria-current="page"{% endif %} href="{{ shrineHomeUrl }}">Shrine Home</a>
</li>
{%- for entry in navPages %}
<li>
<a {% if entry.url == page.url %}aria-current="page"{% endif %} href="{{ entry.url }}">{{ entry.title }}</a>