I am not sure if this is a bug or just my lack of understanding, but
[posts]({{% ref "posts/" %}}) with `%`
behaves differently to
[posts]({{< ref "posts/" >}}) with `<`
I have a render-link hook that parses the URL and adds a target=_blank if the URL is an external URL identified by a http:// prefix.
{{- $page := .Page }}
{{- $content := .Text }}
{{- $url := .Destination }}
{{- $title := .Title | default "" }}
{{- $title = trim $title " " }}
{{- $target := "" }}
{{- if or (strings.HasPrefix $url "http://") (strings.HasPrefix $url "https://") }}
{{- $target = "_blank" }}
{{- end -}}
<a href="{{ $url | safeURL }}"{{ if $title }} title="{{ $title }}"{{ end }}{{ if gt (len $target) 0 }} target="{{ $target }}"{{ end }}>{{ $content | safeHTML }}</a>
This test fails for the second shortcode call syntax and I currently have no clue why that is.
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e windows/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=gohugoio