Remove BookMenuBundleActiveLinkColor parameter

This commit is contained in:
Alex Shpak
2019-10-08 23:17:30 +02:00
parent 394b54f76b
commit 00988ceee1
7 changed files with 5 additions and 28 deletions
+2 -17
View File
@@ -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 }}