-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nav link does not turn active for single pages. #148
Comments
Hi, first thing that jumps to my head is, do you have set the [[menu.main]]
identifier = "about"
name = "About"
url = "/about" If this shloudn't fix your problem, could you please paste your config? |
Hi there, I don't think that's it - this is my current entry:
Thanks! |
Ahh I see the problem. I have played around with it a bit and found a low effort fix. Under It's not the best way to do things but it will get the job done. I'll see if I can get a better fix for this. |
That works absolutely perfectly. Thanks! |
I think I have found another solution. Given your about page is at ---
...
menu:
main:
identifier: about
--- The menu entrie can stay the same as above. I hope this helps you out. // Edit: <nav class="nav" id="navigation">
<ul class="nav__list">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li>
<a {{ if or ($currentPage.IsMenuCurrent "main" .) ( and (eq $currentPage.Kind "section") (eq $currentPage.Section .Identifier)) }} class="active"
{{end}} href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</nav> |
If i Follow your last post i get a WARNING message: is there a more elegant solution to this Problem? |
This resolves jakewies#148 and also supports multilingual sites. Signed-off-by: Diab Neiroukh <[email protected]>
This resolves jakewies#148 and also supports multilingual sites. Signed-off-by: Diab Neiroukh <[email protected]>
This resolves jakewies#148 and also supports multilingual sites. Signed-off-by: Diab Neiroukh <[email protected]>
This resolves jakewies#148 and also supports multilingual sites. Signed-off-by: Diab Neiroukh <[email protected]>
This resolves jakewies#148 and also supports multilingual sites. Signed-off-by: Diab Neiroukh <[email protected]>
The link in the nav bar does not become active when on single pages, only on list and blog pages.
Example: uni.gwood.dev - the About page.
The text was updated successfully, but these errors were encountered: