{{ define "partials/get-title" }} {{ $separator := .Site.Params.titleSeparator | default "|" }} {{ $primarySep := $separator }} {{ $secondarySep := $separator }} {{ if reflect.IsSlice $separator }} {{ $primarySep = index $separator 0 }} {{ $secondarySep = index $separator 1 | default (index $separator 0) }} {{ end }} {{ $title := .Site.Title }} {{/* Generate prefix */}} {{ $prefix := "" }} {{ if .Params.Title }} {{ $prefix = .Params.Title }} {{/* Deprecation warning(v1.0.0) starts */}} {{ $layout := partial "utils/hyphenate" (.Layout | default .Type) }} {{/* Deprecation warning(v1.0.0) ends */}} {{ if and (eq .Type "docs") (ne $layout "doc-list") }} {{ $docTitle := "" }} {{ $bundles := partial "utils/get-bundles" . }} {{ range $bundles.Reverse }} {{ $version := findRE "v?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?" (path.Base .Permalink) }} {{/* Deprecation warning(v1.0.0) starts */}} {{ $parentLayout := partial "utils/hyphenate" (.Parent.Layout | default .Parent.Type) }} {{ $layout := partial "utils/hyphenate" (.Layout | default .Type) }} {{/* Deprecation warning(v1.0.0) ends */}} {{ if and (eq $parentLayout "doc-list") (ne $layout "doc-list") }} {{ $docTitle = .Title }} {{ else if $version }} {{ $docTitle = .Title }} {{ end }} {{ end }} {{/* Doc title */}} {{ $version := findRE "v?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?" (path.Base .Permalink) }} {{/* Deprecation warning(v1.0.0) starts */}} {{ $parentLayout := partial "utils/hyphenate" (.Parent.Layout | default .Parent.Type) }} {{/* Deprecation warning(v1.0.0) ends */}} {{ if or (eq $parentLayout "doc-list") $version }} {{ $prefix = $docTitle }} {{ else }} {{ $prefix = print $prefix " " $secondarySep " " $docTitle }} {{ end }} {{ end }} {{ end }} {{/* Add prefix */}} {{ with $prefix }} {{ $title = print . " " $primarySep " " $title }} {{ end }} {{ return $title }} {{ end }} {{ partial "get-title" . }} {{- $eurekaCSS := resources.Get "css/eureka.css" | postCSS (dict "config" "./assets/css/postcss.config.js") }} {{- $eurekaCSS := $eurekaCSS | minify }} {{- $eurekaJS := resources.Get "js/eureka.js" | resources.ExecuteAsTemplate "js/eureka.js" . | minify }} {{- $assets := .Site.Data.assets }} {{ $highlightjsStyle := .Site.Params.highlight.highlightjs.style | default "solarized-light" }} {{ range .Site.Params.highlight.highlightjs.languages }} {{ end }} {{- $enableMath := false }} {{- if .Site.Params.math.handler }} {{- $bundles := partial "utils/get-bundles" . }} {{- $enableMath = true }} {{- range $bundles.Reverse }} {{- if and (ne .Params.enableMath nil) (ne .Params.enableMath "") }} {{- $enableMath = .Params.enableMath }} {{/* Deprecation warning(v1.0.0) starts */}} {{- else if and (ne .Params.math nil) (ne .Params.math "") }} {{ warnf "Param 'math' in %q is deprecated and will be removed in Eureka v1.0.0. Please use 'enableMath' instead." .File.Path }} {{- $enableMath = .Params.math }} {{/* Deprecation warning(v1.0.0) ends */}} {{- end }} {{- end }} {{- end }} {{ define "partials/camelize" }} {{ $input := . }} {{ $regexp := "(-|_)([a-z])" }} {{ $matches := findRE $regexp $input }} {{ range $matches }} {{ $input = $input | replaceRE . (upper .) }} {{ end }} {{ $input = $input | replaceRE "(-|_)" "" }} {{ return $input }} {{ end }} {{/* KaTeX */}} {{- if and (eq .Site.Params.math.handler "katex") $enableMath }} {{- end }} {{/* Mermaid */}} {{- if eq .Site.Params.diagram.handler "mermaid" }} {{- with .Site.Params.diagram.mermaid }} {{- end }} {{- end }} {{- if and .Site.GoogleAnalytics hugo.IsProduction }} {{- end }} {{ partial "custom-head" . }} {{- with .Site.Params.icon }} {{- end }} {{ define "partials/get-icon" }} {{ $icon := resources.GetMatch .icon }} {{ $iconResized := $icon.Fill (printf "%sx%s Center" (string .size) (string .size)) }} {{ return $iconResized }} {{ end }} {{- partial "components/schema" . }} {{- partial "components/opengraph" . }} {{- range .AlternativeOutputFormats }} {{- printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{- end }}