{{ $scratch := newScratch }} {{ $type := .Get "type" }} {{ $pathData := findRE "[^/]+.*?" .Page.RelPermalink }} {{ $currentTelegrafVersion := replaceRE `v` "" (index $pathData 1) }} {{ $scratch.Set "externalPluginLink" "" }} {{ if and (gt (float $currentTelegrafVersion) 1.18) (le (float $currentTelegrafVersion) 1.21) }} {{ $scratch.Set "externalPluginLink" (print "/telegraf/" (index $pathData 1) "/external_plugins/" )}} {{ else if (ge (float $currentTelegrafVersion) 1.22) }} {{ $scratch.Set "externalPluginLink" (print "/telegraf/" (index $pathData 1) "/configure_plugins/external_plugins/" )}} {{ end }} {{ $externalPluginLink := $scratch.Get "externalPluginLink" }} {{ range (index .Site.Data.telegraf_plugins $type ) }} {{ $pluginTags := delimit .tags " " }} {{ $minorVer := replaceRE `\.[^.]*$` "" .introduced }} {{ $supported := cond (le (index (split $minorVer ".") 0) (index (split $currentTelegrafVersion ".") 0)) (le (index (split $minorVer ".") 1) (index (split $currentTelegrafVersion ".") 1)) false }} {{ if $supported }}

{{ .name }}

{{ if in .tags "external"}} External {{ end }}

Plugin ID: {{ $type }}s.{{ .id }}
Telegraf {{ if not .deprecated }}{{ .introduced }}+{{ else }}{{ .introduced }} - {{ .deprecated }} Deprecated{{ end }}

{{ $scratch.Set "description" .description }} {{ if in .description "{{< latest" }} {{ $latestInstances := findRE `{{< latest .* >}}` .description }} {{ range $latestInstances }} {{ $tmpDescription := $scratch.Get "description" }} {{ $product := replaceRE `"` "" (index (findRE `"[a-z_]*"` .) 0 ) }} {{ $latestVersion := (index $.Site.Data.products $product).latest }} {{ $replace := print "{{< latest \"" $product "\" >}}"}} {{ $replacement := print $product "/" $latestVersion }} {{ $scratch.Set "description" (replaceRE $replace $replacement $tmpDescription) }} {{ end }} {{ end }} {{ $description := $scratch.Get "description" }}

{{ $description | markdownify | safeHTML }}

View
{{ end }} {{ end }}