diff options
Diffstat (limited to 'layouts/partials/docs/menu-bundle.html')
-rw-r--r-- | layouts/partials/docs/menu-bundle.html | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/layouts/partials/docs/menu-bundle.html b/layouts/partials/docs/menu-bundle.html index eced12e..ddaac52 100644 --- a/layouts/partials/docs/menu-bundle.html +++ b/layouts/partials/docs/menu-bundle.html @@ -1,19 +1,4 @@ -{{ template "hrefhack" . }} {{ with .Site.GetPage .Site.Params.BookMenuBundle }} - {{- .Content -}} -{{ end }} - -{{ define "hrefhack" }} - {{ $attrEq := "$=" }} - {{ $attrVal := .RelPermalink }} - {{ if eq .RelPermalink "/" }} - {{ $attrEq = "=" }} - {{ $attrVal = .Permalink }} - {{ end }} - - <style> - nav ul a[href{{ $attrEq }}"{{ $attrVal }}"] { - color: {{ default "#004ed0" .Site.Params.BookMenuBundleActiveLinkColor }}; - } - </style> + {{- $href := printf "href=\"%s\"" $.RelPermalink -}} + {{- replace .Content $href (print $href "class=active") | safeHTML -}} {{ end }} |