docs-v2/layouts/partials/article/flux-experimental.html

25 lines
1.2 KiB
HTML

{{ $currentVersion := index (findRE "[^/]+.*?" .RelPermalink) 1 }}
{{ $expRiskURL := print "/influxdb/" $currentVersion "/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk" }}
{{ $expPath := print "/influxdb/" $currentVersion "/reference/flux/stdlib/experimental/" }}
{{ if in .RelPermalink $expPath }}
{{ if not (eq .RelPermalink $expPath) }}
{{ if eq .Kind "page" }}
{{ $name := replaceRE `^\w*\.\w*\(\)` "<code>$0</code>" .Title }}
<div class="warn block">
<p>
The {{ $name | safeHTML }} is {{ if in $name "experimental" }}{{ else }}experimental and{{ end }} subject to change at any time.
By using this function, you accept the <a href="{{ $expRiskURL }}">risks of experimental functions</a>.
</p>
</div>
{{ else if eq .Kind "section" }}
<div class="warn block">
<p>
The {{ if $.Params.list_title }}{{ $.Params.list_title }}{{ else }}{{ .Title }}{{ end }} is experimental and subject to change at any time.
By using this package, you accept the <a href="{{ $expRiskURL }}">risks of experimental functions</a>.
</p>
</div>
{{ end }}
{{ end }}
{{ end }}