Show correct side menu in news entries

This commit is contained in:
Christian Wolf 2024-01-04 15:57:23 +01:00
parent a0cf3bef07
commit 28e9d32e2c
2 changed files with 10 additions and 2 deletions

View File

@ -27,7 +27,11 @@
<div id="nav-border" class="container nav"> <div id="nav-border" class="container nav">
<nav id="nav" class="nav justify-content-center"> <nav id="nav" class="nav justify-content-center">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<a class="nav-link{{ if or ($.Page.IsMenuCurrent "main" .) ($.Page.HasMenuCurrent "main" .) }} active{{ end }}" href="{{ .URL }}"> <a class="nav-link{{ if or
($.Page.IsMenuCurrent "main" .)
($.Page.HasMenuCurrent "main" .)
(and (eq $.Page.Type "news") (eq .Identifier "aktuell"))
}} active{{ end }}" href="{{ .URL }}">
{{/*{{ if .Pre }} {{/*{{ if .Pre }}
{{ $icon := printf "<i data-feather=\"%s\"></i> " .Pre | safeHTML }} {{ $icon := printf "<i data-feather=\"%s\"></i> " .Pre | safeHTML }}
{{ $icon }} {{ $icon }}

View File

@ -1,6 +1,10 @@
{{ $currentPage := .Page }} {{ $currentPage := .Page }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} {{ if or
($currentPage.IsMenuCurrent "main" .)
($currentPage.HasMenuCurrent "main" .)
(and (eq $currentPage.Type "news") (eq .Identifier "aktuell") )
}}
{{ if .HasChildren }} {{ if .HasChildren }}
{{ range .Children }} {{ range .Children }}
{{ $submenu := "" }} {{ $submenu := "" }}