1
0
Fork 0
mirror of https://github.com/TheThomaas/my-online-cookbook.git synced 2026-01-11 04:11:47 +00:00

Make home title configurable in CMS

This commit is contained in:
Maël Brunet 2021-05-22 13:06:44 +02:00
parent 2fedfdd43f
commit 8b7080bbdc
2 changed files with 12 additions and 7 deletions

View file

@ -1,5 +1,9 @@
{
"items": [
{
"text": "Home",
"url": "/"
},
{
"text": "All recipes",
"url": "/recipes/"

View file

@ -1,14 +1,15 @@
<nav class="c-nav">
<ul class="c-nav__list">
<li>
<a href="/" class="c-nav__home">
<span class="c-nav__logo">{% include "icons/logo.svg" %}</span>
<span class="c-nav__nav-item c-nav__home-text {{ 'c-nav__nav-item--active' if page.url == '/' }}">Home</span>
</a>
</li>
{% for navItem in nav.items %}
<li>
{% if navItem.url == "/" %}
<a href="/" class="c-nav__home">
<span class="c-nav__logo">{% include "icons/logo.svg" %}</span>
<span class="c-nav__nav-item c-nav__home-text {{ 'c-nav__nav-item--active' if page.url == '/' }}">{{ navItem.text }}</span>
</a>
{% else%}
<a href="{{ navItem.url }}" class="c-nav__nav-item {{ 'c-nav__nav-item--active' if page.url == navItem.url }}">{{ navItem.text }}</a>
{% endif %}
</li>
{% endfor %}
</ul>