hotfix: fixed product dropdown link bug, fixed search latest tag
parent
1e356c8197
commit
9cf8aa4803
|
@ -1,7 +1,7 @@
|
|||
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
|
||||
{{ $product := index $productPathData 0 | default "none" }}
|
||||
{{ $currentVersion := index $productPathData 1 | default "none" }}
|
||||
{{ $isLatest := cond (eq .Kind "home") true (or (eq $currentVersion (index $.Site.Data.products $product).latest) (eq $currentVersion "cloud") (eq $product "platform") (eq $product "resources")) }}
|
||||
{{ $isLatest := cond (eq .Kind "home") true (or (eq $currentVersion (replaceRE `\.[0-9x]+$` "" (index $.Site.Data.products $product).latest)) (eq $currentVersion "cloud") (eq $currentVersion "clustered") (eq $product "platform") (eq $product "resources")) }}
|
||||
|
||||
<meta name="latest" content="{{ cond $isLatest true false }}">
|
||||
<meta name="last-modified" content="{{ .Lastmod }}">
|
|
@ -7,7 +7,7 @@
|
|||
{{ $searchTag := print $product "-" $currentVersion }}
|
||||
|
||||
{{ if not .IsHome }}
|
||||
{{ if or (eq $currentVersion (index $.Site.Data.products $product).latest) (or (eq $product "platform") (eq $product "resources")) (in $currentVersion "cloud") }}
|
||||
{{ if or (eq $currentVersion (replaceRE `\.[0-9x]+$` "" (index $.Site.Data.products $product).latest)) (or (eq $product "platform") (eq $product "resources")) (in $currentVersion "cloud") (in $currentVersion "clustered") }}
|
||||
<meta name="docsearch:latest" content="true">
|
||||
{{ end }}
|
||||
{{ if and (ne $product "platform") (ne $product "resources") (ne $currentVersion "") }}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ else if $isCurrentProduct }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "link" "" }}
|
||||
{{ end }}
|
||||
{{ $link := $scratch.Get "link" }}
|
||||
|
@ -78,7 +78,7 @@
|
|||
{{ if not $isCurrentProduct }}
|
||||
{{ $scratch.Set "link" (print "/" .namespace "/" (index .versions 0) "/") }}
|
||||
|
||||
{{ if eq $product "influxdb" }}
|
||||
{{ if and (eq $product "influxdb") (gt (len (findRE `^influxdb` .namespace)) 0) }}
|
||||
{{ $replacementPath := index (index $influxdbInfo .name) "path" }}
|
||||
{{ $altProductPage := $.GetPage ((replaceRE $pageRoot $replacementPath $.Page.RelPermalink) | replaceRE `\/$` "") }}
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ else if $isCurrentProduct }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "link" "" }}
|
||||
{{ end }}
|
||||
|
||||
|
@ -113,7 +113,7 @@
|
|||
{{ if not $isCurrentProduct }}
|
||||
{{ $scratch.Set "link" (print "/" .namespace "/" (index .versions 0) "/") }}
|
||||
|
||||
{{ if eq $product "influxdb" }}
|
||||
{{ if and (eq $product "influxdb") (gt (len (findRE `^influxdb` .namespace)) 0) }}
|
||||
{{ $replacementPath := index (index $influxdbInfo .name) "path" }}
|
||||
{{ $altProductPage := $.GetPage ((replaceRE $pageRoot $replacementPath $.Page.RelPermalink) | replaceRE `\/$` "") }}
|
||||
|
||||
|
@ -126,11 +126,11 @@
|
|||
|
||||
{{/* ///////////// GET DEFAULT ALT PAGE AT SAME PATH //////////// */}}
|
||||
{{ else if gt (len $altProductPage.Title) 0 }}
|
||||
{{ $scratch.Set "link" $altProductPage.RelPermalink }}
|
||||
{{ $scratch.Set "link" $altProductPage.RelPermalink }} true
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ else if $isCurrentProduct }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "link" "" }}
|
||||
{{ end }}
|
||||
{{ $link := $scratch.Get "link" }}
|
||||
|
@ -147,7 +147,7 @@
|
|||
{{ if not $isCurrentProduct }}
|
||||
{{ $scratch.Set "link" (print "/" .namespace "/" (index .versions 0) "/") }}
|
||||
|
||||
{{ if eq $product "influxdb" }}
|
||||
{{ if and (eq $product "influxdb") (gt (len (findRE `^influxdb` .namespace)) 0) }}
|
||||
{{ $replacementPath := index (index $influxdbInfo .name) "path" }}
|
||||
{{ $altProductPage := $.GetPage ((replaceRE $pageRoot $replacementPath $.Page.RelPermalink) | replaceRE `\/$` "") }}
|
||||
|
||||
|
@ -164,7 +164,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ else if $isCurrentProduct }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "link" "" }}
|
||||
{{ end }}
|
||||
{{ $link := $scratch.Get "link" }}
|
||||
|
|
Loading…
Reference in New Issue