26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
{{ $scratch := newScratch }}
|
|
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
|
|
{{ $product := index $productPathData 0 }}
|
|
{{ $currentVersion := index $productPathData 1 }}
|
|
|
|
{{ $scratch.Set "siteTitle" "InfluxData Documentation" }}
|
|
{{ if eq $product nil }}
|
|
{{ $scratch.Set "siteTitle" "InfluxData Documentation" }}
|
|
{{ else if eq $product "platform"}}
|
|
{{ $scratch.Set "siteTitle" "InfluxData Platform Documentation" }}
|
|
{{ else if eq $currentVersion nil}}
|
|
{{ $scratch.Set "siteTitle" (print (index .Site.Data.products $product).name " Documentation") }}
|
|
{{ else }}
|
|
{{ $scratch.Set "siteTitle" (print (index .Site.Data.products $product).name " " $currentVersion " Documentation") }}
|
|
{{ end }}
|
|
|
|
{{ $scratch.Set "pageTitle" "" }}
|
|
{{ if or (eq $product "platform") (gt (len $productPathData) 2) }}
|
|
{{ $scratch.Set "pageTitle" (cond (ne .Params.seotitle nil) .Params.seotitle .Title) }}
|
|
{{ end }}
|
|
|
|
{{ $pageTitle := $scratch.Get "pageTitle" }}
|
|
{{ $siteTitle := $scratch.Get "siteTitle" }}
|
|
|
|
<title>{{ $pageTitle }}{{ cond (ne (len $pageTitle) 0) " | " "" }}{{ $siteTitle }}</title>
|