{{ 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>
{{ end }}
