2019-02-12 14:44:36 +00:00
|
|
|
{{/*These templates contains some more complex logic and shared between partials*/}}
|
2018-09-17 16:29:36 +00:00
|
|
|
{{ define "title" }}
|
|
|
|
{{- if .Pages -}}
|
|
|
|
{{ $sections := split (trim .Dir "/") "/" }}
|
|
|
|
{{ $title := index ($sections | last 1) 0 | humanize | title }}
|
2018-09-17 23:35:54 +00:00
|
|
|
{{- default $title .Title -}}
|
2018-09-17 16:29:36 +00:00
|
|
|
{{- else -}}
|
|
|
|
{{ $title := .File | humanize | title }}
|
2018-09-17 23:35:54 +00:00
|
|
|
{{- default $title .Title -}}
|
2018-09-17 16:29:36 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{ end }}
|
2019-02-13 22:31:13 +00:00
|
|
|
|
|
|
|
{{ 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 }}
|