diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d40bb0eb8..c0bb21124 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -998,6 +998,56 @@ Use either `includeRange` argument name or provide the boolean value as the thir {{% flux/sample "int" true true %}} ``` +### Duplicate OSS content in Cloud +Docs for InfluxDB OSS and InfluxDB Cloud share a majority of content. +To prevent duplication of content between versions, use the following shortcodes: + +- `{{< duplicate-oss >}}` +- `{{% oss-only %}}` +- `{{% cloud-only %}}` + +#### duplicate-oss +The `{{< duplicate-oss >}}` shortcode copies the page content of the file located +at the identical file path in the most recent InfluxDB OSS version. +The Cloud version of this markdown file should contain the frontmatter required +for all pages, but the body content should just be the `{{< duplicate-oss >}}` shortcode. + +#### oss-only +Wrap content that should only appear in the OSS version of the doc with the `{{% oss-only %}}` shortcode. +Use the shortcode on both inline and content blocks: + +```md +{{% oss-only %}}This is inline content that only renders in the InfluxDB OSS docs{{% /oss-only %}} + +{{% oss-only %}} + +This is a multi-paragraph content block that spans multiple paragraphs and will +only render in the InfluxDB OSS documentation. + +**Note:** Notice the blank newline after the opening short-code tag. +This is necessary to get the first sentence/paragraph to render correctly. + +{{% /oss-only %}} +``` + +#### cloud-only +Wrap content that should only appear in the Cloud version of the doc with the `{{% cloud-only %}}` shortcode. +Use the shortcode on both inline and content blocks: + +```md +{{% cloud-only %}}This is inline content that only renders in the InfluxDB Cloud docs{{% /cloud-only %}} + +{{% cloud-only %}} + +This is a multi-paragraph content block that spans multiple paragraphs and will +only render in the InfluxDB Cloud documentation. + +**Note:** Notice the blank newline after the opening short-code tag. +This is necessary to get the first sentence/paragraph to render correctly. + +{{% /cloud-only %}} +``` + ### Reference content The InfluxDB documentation is "task-based," meaning content primarily focuses on what a user is **doing**, not what they are **using**. diff --git a/content/influxdb/v2.0/reference/cli/influx/task/retry-failed.md b/content/influxdb/v2.0/reference/cli/influx/task/retry-failed.md index 40a81d588..3be6c9495 100644 --- a/content/influxdb/v2.0/reference/cli/influx/task/retry-failed.md +++ b/content/influxdb/v2.0/reference/cli/influx/task/retry-failed.md @@ -39,6 +39,11 @@ influx task retry-failed [flags] {{< cli/influx-creds-note >}} +{{% note %}} +#### Required permissions +Use an [{{% oss-only %}}**Operator** or{{% /oss-only %}} **All-Access** token](/influxdb/v2.0/security/tokens/) to retry failed tasks. +{{% /note %}} + - [Retry failed task runs for a specific task ID](#retry-failed-task-runs-for-a-specific-task-id) - [Retry failed task runs that occurred before a specific time](#retry-failed-task-runs-that-occurred-before-a-specific-time) - [Retry failed task runs that occurred after a specific time](#retry-failed-task-runs-that-occurred-after-a-specific-time) diff --git a/content/influxdb/v2.0/reference/cli/influx/task/run/retry.md b/content/influxdb/v2.0/reference/cli/influx/task/run/retry.md index 4f5f1e2aa..11b738d47 100644 --- a/content/influxdb/v2.0/reference/cli/influx/task/run/retry.md +++ b/content/influxdb/v2.0/reference/cli/influx/task/run/retry.md @@ -32,6 +32,11 @@ influx task run retry [flags] {{< cli/influx-creds-note >}} +{{% note %}} +#### Required permissions +Use an [{{% oss-only %}}**Operator** or{{% /oss-only %}} **All-Access** token](/influxdb/v2.0/security/tokens/) to retry tasks. +{{% /note %}} + ##### Retry a task run ```sh influx task run retry \ diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 93cf683df..e9a4f28ae 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -8,7 +8,7 @@ {{ partial "article/flux-experimental.html" . }} {{ partial "article/flux-contrib.html" . }} {{ partial "article/prepend.html" . }} - {{ .Content }} + {{ partial "article/content.html" . }} {{ partial "article/append.html" . }} {{ partial "article/related.html" . }} {{ partial "article/tags.html" . }} diff --git a/layouts/partials/article/content.html b/layouts/partials/article/content.html new file mode 100644 index 000000000..e9d16630d --- /dev/null +++ b/layouts/partials/article/content.html @@ -0,0 +1,13 @@ +{{ $productPathData := findRE "[^/]+.*?" .RelPermalink }} +{{ $product := index $productPathData 0 }} +{{ $version := index $productPathData 1 }} +{{ $influxdbOSS := and (eq $product "influxdb") (ne $version "cloud") }} +{{ $influxdbCloud := and (eq $product "influxdb") (eq $version "cloud") }} + +{{ if $influxdbOSS }} + {{ .Content | replaceRE `(?U)(.*<\/span><\!\-\- close \-\-\>)` "" | replaceRE `(?Us)(
.*<\/div><\!\-\- close \-\-\>)` "" | safeHTML}} +{{ else if $influxdbCloud }} + {{ .Content | replaceRE `(?U)(.*<\/span><\!\-\- close \-\-\>)` "" | replaceRE `(?Us)(
.*<\/div><\!\-\- close \-\-\>)` "" | safeHTML}} +{{ else }} + {{ .Content }} +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/cloud-only.html b/layouts/shortcodes/cloud-only.html new file mode 100644 index 000000000..ac522f799 --- /dev/null +++ b/layouts/shortcodes/cloud-only.html @@ -0,0 +1,3 @@ +{{- $el := cond (gt (len (findRE `\n` .Inner)) 0) "div" "span" -}} +{{- $output := print "<" $el " class='cloud-only'>" .Inner "" | safeHTML -}} +{{ $output }} \ No newline at end of file diff --git a/layouts/shortcodes/oss-only.html b/layouts/shortcodes/oss-only.html new file mode 100644 index 000000000..905bf894c --- /dev/null +++ b/layouts/shortcodes/oss-only.html @@ -0,0 +1,3 @@ +{{- $el := cond (gt (len (findRE `\n` .Inner)) 0) "div" "span" -}} +{{- $output := print "<" $el " class='oss-only'>" .Inner "" | safeHTML -}} +{{ $output }} \ No newline at end of file