docs-v2/layouts/shortcodes/cli/influxd-flags.html

19 lines
895 B
HTML

{{- $productPathData := findRE "[^/]+.*?" .Page.RelPermalink -}}
{{- $currentVersion := replaceRE "v" "" (index $productPathData 1) -}}
{{- $flags := .Site.Data.influxd_flags -}}
<ul>
{{- range $flags -}}
{{- $flagAnchor := replaceRE "--" "#" .flag -}}
{{- $removed := cond (isset . "removed") .removed 1000.0 -}}
{{- $deprecated := cond (isset . "deprecated") true false -}}
{{- $deprecatedVersion := cond $deprecated .deprecated 0.0 -}}
{{- if and (ge (float $currentVersion) .added) (lt (float $currentVersion) $removed) -}}
<li>
{{ if .nolink }}{{ .flag }}{{ else }}<a href="/influxdb/v{{ $currentVersion }}/reference/config-options/{{ $flagAnchor }}">{{ .flag }}</a>{{ end }}
{{ if and $deprecated (ge (float $currentVersion) $deprecatedVersion) }}<em style="opacity:.65;"> - (deprecated in InfluxDB {{ $deprecatedVersion }})</em>{{ end }}
</li>
{{- end -}}
{{- end -}}
</ul>