{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}} {{- define "content" -}} {{- $params := .Scratch.Get "params" -}} {{- $toc := $params.toc -}} {{- if eq $toc true -}} {{- $toc = .Site.Params.page.toc | default dict -}} {{- else if eq $toc false -}} {{- $toc = dict "enable" false -}} {{- end -}} {{- /* Auto TOC */ -}} {{- if $toc.enable | and (eq $toc.keepStatic false) -}}

{{ T "contents" }}

{{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- end -}} {{- /* TOC Style */ -}} {{- if eq $toc.enable true -}} {{- if eq $toc.keepStatic true -}} {{- else -}} {{- end -}} {{- else if eq $toc.enable false -}} {{- end -}}
{{- /* Title */ -}}

{{ .Title }}

{{- /* Subtitle */ -}} {{- with $params.subtitle -}}

{{ . }}

{{- end -}} {{- /* Meta */ -}}
{{- /* Featured image */ -}} {{- $image := $params.featuredimage -}} {{- $width := "auto" -}} {{- $height := "auto" -}} {{- with .Resources.GetMatch (printf "**%s" $params.featuredimage) -}} {{- if eq .ResourceType "image" -}} {{- $image = .RelPermalink -}} {{- $width = .Width -}} {{- $height = .Height -}} {{- else -}} {{- warnf "invalid featured image detected!" -}} {{- end -}} {{- end -}} {{- with .Resources.GetMatch "featured-image" -}} {{- $image = .RelPermalink -}} {{- $width = .Width -}} {{- $height = .Height -}} {{- end -}} {{- with $image -}} {{- end -}} {{- /* Series list */ -}} {{- if $params.series | and $params.seriesNavigation -}} {{- range $key, $value := .Site.Taxonomies.series -}} {{- range $params.series -}} {{- if . | urlize | eq ($key | urlize) -}} {{- $term := $.Site.GetPage "series" $key -}}
{{ T "series" }} - {{ $term.Title }}
{{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- /* Static TOC */ -}} {{- if $toc.enable -}}
{{ T "contents" }}
{{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- end -}} {{- /* Content */ -}}
{{- /* Outdated Article Reminder */ -}} {{- partial "single/outdatedArticleReminder.html" . -}} {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{/* Related Content */}} {{- if $params.related.enable -}} {{- partial "related.html" . -}} {{- end -}} {{/* Sponsor */}} {{- partial "single/sponsor.html" . -}} {{- /* Footer */ -}} {{- partial "single/footer.html" . -}} {{- /* Comment */ -}} {{- partial "comment.html" . -}}
{{- end -}}