92 lines
5.8 KiB
HTML
92 lines
5.8 KiB
HTML
{{ $scratch := newScratch }}
|
|
{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }}
|
|
{{ $product := index $productPathData 0 }}
|
|
{{ $version := index $productPathData 1 }}
|
|
{{ $pageRoot := print $product "/" $version }}
|
|
{{ $useRootProductLink := or (eq $product nil) (in (slice "resources" "platform") $product) }}
|
|
{{ $altLinks := .Page.Params.alt_links | default dict }}
|
|
|
|
<!--
|
|
Identify products by their product path. Dictionary schema:
|
|
- Key: Product path (product/version)
|
|
Value: Slice containing two elements:
|
|
- 0: Product name
|
|
- 1: Frontmatter alt_link key for explicit declarations of alternate links
|
|
-->
|
|
{{ $influxdbOSSv1 := dict "influxdb/v1" (slice "InfluxDB OSS v1" "v1") }}
|
|
{{ $influxdbOSSv2 := dict "influxdb/v2" (slice "InfluxDB OSS v2" "v2") }}
|
|
{{ $influxdbCloud := dict "influxdb/cloud" (slice $.Site.Data.products.influxdb_cloud.name "cloud") }}
|
|
{{ $influxdb3Core := dict "influxdb3/core" (slice $.Site.Data.products.influxdb3_core.name "core") }}
|
|
{{ $influxdb3Enterprise := dict "influxdb3/enterprise" (slice $.Site.Data.products.influxdb3_enterprise.name "enterprise") }}
|
|
{{ $influxdb3Explorer := dict "influxdb3/explorer" (slice $.Site.Data.products.influxdb3_explorer.name "explorer") }}
|
|
{{ $influxdb3CloudServerless := dict "influxdb3/cloud-serverless" (slice $.Site.Data.products.influxdb3_cloud_serverless.name "cloud-serverless") }}
|
|
{{ $influxdb3CloudDedicated := dict "influxdb3/cloud-dedicated" (slice $.Site.Data.products.influxdb3_cloud_dedicated.name "cloud-dedicated") }}
|
|
{{ $influxdb3Clustered := dict "influxdb3/clustered" (slice $.Site.Data.products.influxdb3_clustered.name "clustered") }}
|
|
{{ $telegraf := dict "telegraf/v1" (slice "Telegraf" "telegraf") }}
|
|
{{ $chronograf := dict "chronograf/v1" (slice "Chronograf" "chronograf") }}
|
|
{{ $kapacitor := dict "kapacitor/v1" (slice "Kapacitor" "kapacitor") }}
|
|
{{ $flux := dict "flux/v0" (slice "Flux" "flux") }}
|
|
{{ $enterpriseInfluxdb := dict "enterprise_influxdb/v1" (slice "InfluxDB Enterprise" "enterprise_v1") }}
|
|
|
|
{{ $productInfo := merge $influxdbOSSv1 $influxdbOSSv2 $influxdbCloud $influxdb3Core $influxdb3Enterprise $influxdb3CloudServerless $influxdb3CloudDedicated $influxdb3Clustered $telegraf $chronograf $kapacitor $influxdb3Explorer $flux $enterpriseInfluxdb }}
|
|
|
|
{{ define "productLink" }}
|
|
{{ $defaultAltProductPage := $.context.GetPage ((replaceRE .pageRoot .productPath $.context.Page.RelPermalink) | replaceRE `\/$` "") }}
|
|
{{ $defaultAltProductPageExists := gt (len $defaultAltProductPage.Title) 0 }}
|
|
{{ $productName := index (index $.productInfo .productPath) 0 }}
|
|
{{ $productAltLinkKey := index (index $.productInfo .productPath) 1 }}
|
|
{{ $isCurrentProduct := in $.context.RelPermalink .productPath }}
|
|
{{ $link := cond .useRootProductLink (print "/" .productPath "/") (cond (isset .altLinks $productAltLinkKey) (index .altLinks $productAltLinkKey) (cond $defaultAltProductPageExists $defaultAltProductPage.RelPermalink (print "/" .productPath "/"))) }}
|
|
{{ $state := .state | default "" }}
|
|
<a href='{{ $link }}' {{ if $isCurrentProduct }}class="active"{{ end }}>{{ index (index $.productInfo .productPath) 0 }}{{ if ne $state ""}} <span class="state">{{ $state }}</span>{{ end }}</a>
|
|
{{ end }}
|
|
|
|
{{ $templateDefaults := dict "context" . "productInfo" $productInfo "altLinks" $altLinks "pageRoot" $pageRoot "useRootProductLink" $useRootProductLink }}
|
|
|
|
<div class="product-list">
|
|
<div id="product-dropdown">
|
|
<p class="selected">{{ index (index $productInfo $pageRoot) 0 | default "Select product" }}</p>
|
|
</div>
|
|
<div id="dropdown-items">
|
|
<div class="product-group">
|
|
<div class="group-title"><p>InfluxDB 3</p></div>
|
|
<ul class="item-list products" data-category="Self-managed">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/core" "state" "New") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/enterprise" "state" "New") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/clustered") $templateDefaults) }}</li>
|
|
</ul>
|
|
<ul class="item-list products" data-category="Fully-Managed">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/cloud-serverless") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/cloud-dedicated") $templateDefaults) }}</li>
|
|
</ul>
|
|
<ul class="item-list products" data-category="Tools">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb3/explorer" "state" "beta") $templateDefaults) }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="product-group">
|
|
<div class="group-title"><p>InfluxDB 2</p></div>
|
|
<ul class="item-list products">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb/v2") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb/cloud") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "flux/v0") $templateDefaults) }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="product-group">
|
|
<div class="group-title"><p>InfluxDB 1</p></div>
|
|
<ul class="item-list products">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "influxdb/v1") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "enterprise_influxdb/v1") $templateDefaults) }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="product-group">
|
|
<div class="group-title"><p>Other products</p></div>
|
|
<ul class="item-list products">
|
|
<li>{{ template "productLink" (merge (dict "productPath" "telegraf/v1") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "chronograf/v1") $templateDefaults) }}</li>
|
|
<li>{{ template "productLink" (merge (dict "productPath" "kapacitor/v1") $templateDefaults) }}</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|