From ff4b8d4f2294978303977cbd8452b2a1d24e7d34 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Fri, 14 Feb 2025 14:47:29 -0600 Subject: [PATCH] chore: Add product-key shortcode - displays the short version name extracted from the current page URL. --- CONTRIBUTING.md | 19 +++++++++++++++++++ content/shared/v3-core-plugins/_index.md | 2 +- layouts/shortcodes/product-key.html | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/product-key.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aad3f3e96..e38f0b9e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/content/shared/v3-core-plugins/_index.md b/content/shared/v3-core-plugins/_index.md index aaa004a7a..6372276fd 100644 --- a/content/shared/v3-core-plugins/_index.md +++ b/content/shared/v3-core-plugins/_index.md @@ -255,7 +255,7 @@ influxdb3 install package --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 \ diff --git a/layouts/shortcodes/product-key.html b/layouts/shortcodes/product-key.html new file mode 100644 index 000000000..234e245be --- /dev/null +++ b/layouts/shortcodes/product-key.html @@ -0,0 +1,3 @@ +{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}} +{{- $currentProduct := index $productPathData 1 -}} +{{ $currentProduct }}