chore: Add product-key shortcode - displays the short version name extracted from the current page URL.

get-product-edition
Jason Stirnaman 2025-02-14 14:47:29 -06:00
parent 2c1f2aaae8
commit ff4b8d4f22
3 changed files with 23 additions and 1 deletions

View File

@ -546,6 +546,25 @@ Insert warning markdown content here.
{{% /warn %}}
```
### Product data
Display the full product name and version name for the current page--for example:
- InfluxDB 3 Core
- InfluxDB 3 Cloud Dedicated
```md
{{% product-name %}}
```
Display the short version name (part of the key used in `products.yml`) from the current page URL--for example:
- `/influxdb3/core` returns `core`
```md
{{% product-key %}}
```
### Enterprise Content
For sections content that relate specifically to InfluxDB Enterprise, use the `{{% enterprise %}}` shortcode.

View File

@ -255,7 +255,7 @@ influxdb3 install package <PACKAGE_NAME>
--name CONTAINER_NAME \
-v /path/to/.influxdb3/data:/data \
-v /path/to/.influxdb3/plugins:/plugins \
quay.io/influxdb/influxdb3-core:latest \
quay.io/influxdb/influxdb3-{{< product-key >}}:latest \
serve --node-id=node0 \
--object-store=file \
--data-dir=/data \

View File

@ -0,0 +1,3 @@
{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}}
{{- $currentProduct := index $productPathData 1 -}}
{{ $currentProduct }}