I had this in my settings.yml
menu :
- {name: 'Blogs', url: 'blogs'}
- {name: 'Work', url: 'work'}
- {name: 'Books', url: 'books'}
- {name: 'Projects', url: 'projects'}
- {name: 'Journal', url: 'journals'}
and so I looped it out in my html
<nav class="nav-links">
{% for item in site.data.settings.menu %}
<a href="{{ site.github.url }}/{{ item.url }}" class="text-grey-dark font-sans font-bold no-underline hover:text-black">
{{ item.name }}
</a>
{% endfor %}
</nav>
But what if I want to also add an active class to the Blogs link that starts with ‘/blog/’ url because I have a page that also shows my blog which is the link is like /blog/blue-sky
not /blogs/blue-sky
In the /blogs
url I show all the blogs but in the /blog/2024-first-blog
only a single blog is shown.
I want that Blogs link to be highlighted also when I’m on /blog/**
page.
Thanks in advance, I am asking this because I don’t have the luxury of time to read all the blogs inside this phenomenal page, as I have an another job that reqiures my full attention, I’m just finishing my simple website.