{{ $isRedirected := findRE "^(|../|/docs/(languages|platforms)/.+?/)(api|daily-builds)(/.*)?(\\?.*)?$" .Destination -}} {{ $isExternal := or (hasPrefix .Destination "http") $isRedirected -}} {{/* Until Hugo supports hook params (https://github.com/gohugoio/hugo/issues/6670), we'll inspect .Text. */ -}} {{ $noExternalIcon := in .Text "hk-no-external-icon" -}} {{- .Text | safeHTML -}} {{ if and $isExternal (not $noExternalIcon) -}} {{- end -}} {{- /* This directive ensures that all trailing whitespace is trimmed. */ -}}