Found nothing about my problem. My Hugo version is 0.108, OS is Windows 10 19045.4412
So, I have a YAML-file, which contains the following field:
external_link: https://hello.world.whats.app/lets/go/for/walk
Also, I have a shortcode for reading from this file:
{{- $dataPath := .Get 0 -}}
{{- with split $dataPath "." -}}
{{- $data := site.Data -}}
{{- range . -}}
{{- $data = index $data . -}}
{{- end -}}
{{- $data -}}
{{- end -}}
And I have following markdown:
[external link from file]({{< get-site-data "yaml_file.external_link" >}})
[external link hard-coded](https://hello.world.whats.app/lets/go/for/walk)
I created render-link.html
hook for processing them, but I see the strange behavior with the link which is read from the file.
When I do
strings.Contains .Destination "http"
It returns false for [external link from file], but true for [external link hard-coded]. I tried to output this .Destination
, but it is almost the same for both links.
When I run
{{- $urlData := urls.Parse .Destination -}}
{{- $urlData.IsAbs -}}
It prints false and true correspondingly.