12345678910111213141516171819202122232425262728 |
- {{/*These templates contains some more complex logic and shared between partials*/}}
- {{- define "title" -}}
- {{- if .File -}}
- {{- if .Pages -}}
- {{ $sections := split (trim .File.Dir "/") "/" }}
- {{ $title := index ($sections | last 1) 0 | humanize | title }}
- {{- default $title .Title -}}
- {{- else -}}
- {{ $title := .File.BaseFileName | humanize | title }}
- {{- default $title .Title -}}
- {{- 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 -}}
|