#22: Move href hack to partial
This commit is contained in:
parent
fda5e7a046
commit
4297ab1c08
2 changed files with 16 additions and 5 deletions
|
@ -1,8 +1,4 @@
|
||||||
<style>
|
{{- template "hrefhack" . -}}
|
||||||
nav ul a[href$="{{- .RelPermalink -}}"] {
|
|
||||||
color: {{ default "#004ed0" .Site.Params.BookMenuBundleActiveLinkColor }};
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
|
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
|
||||||
{{- .Content -}}
|
{{- .Content -}}
|
||||||
{{ end }}
|
{{ end }}
|
|
@ -9,3 +9,18 @@
|
||||||
{{- default $title .Title -}}
|
{{- default $title .Title -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ end }}
|
{{ 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 }}
|
Loading…
Reference in a new issue