{{ $scratch := newScratch }} {{ $type := .Get "type" }} {{ $pathData := findRE "[^/]+.*?" .Page.RelPermalink }} {{ $currentTelegrafVersion := replaceRE `v` "" (index $pathData 1) }} {{ 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 }}
External
{{ 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 }}