{{ $currentVersion := (index (findRE "[^/]+.*?" .RelPermalink) 0) .RelPermalink }}
{{ $expRiskURL := print "/" $currentVersion "/reference/flux/stdlib/experimental/#use-experimental-functions-at-your-own-risk" }}
{{ $expPath := print "/" $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 }}
