Assuming a have a slice of dict:
{{ $shareIcons := slice
(dict "name" "twitter" "icon" "twitter.svg" "href" "https://twitter.com/query={{ .Permalink }}" )
(dict "name" "facebook" "icon" "facebook.svg" "href" "..." )
(dict "name" "linkedin" "icon" "linkedin.svg" "href" "..." )
}}
and I range through that this way:
{{ range $shareIcons }}
<a
href="{{ .href }}"
>
</a>
{{ end }}
then twitter.href gets rendered as
WARN https://twitter.com/query={{ .Permalink }}
Why? Are there any other elegant ways to get .Permalink in querystring?