-
|
Is it possible to highlight/underline the active page in the masthead (navigation bar)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Yes, it's possible! In {% if link.url == page.url %} class="active"{% endif %}In {% include masthead.html %}In Here is a commit to show these changes in context: jedick/jedick.github.io@f4e2a78 I hope this helps anybody else coming across this question as I did. I was having no luck with AI answers about styling links in |
Beta Was this translation helpful? Give feedback.
Yes, it's possible!
In
_includes/masthead.htmlset the class attribute for the activemasthead__menu-itemlink.{% if link.url == page.url %} class="active"{% endif %}In
_layouts/default.html, change aninclude_cachedtoinclude. The cached version of the masthead (as used in Minimal Mistakes) does not have the currentpage.url- for me it was always the URL of the first blog post.{% include masthead.html %}In
assets/css/main.scssadd CSS to style the active menu item.Here is a commit to show these changes in context: jedick/jedick.github.io@f4e2a78
I hope this helps anybody else coming across this question as I did. I was having no…