github.com/neohugo/neohugo@v0.123.8/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html (about)

     1  {{- $u := urls.Parse .Destination -}}
     2  {{- $href := $u.String -}}
     3  {{- if strings.HasPrefix $u.String "#" }}
     4    {{- $href = printf "%s#%s" .Page.RelPermalink $u.Fragment }}
     5  {{- else if not $u.IsAbs -}}
     6    {{- with or
     7      ($.Page.GetPage $u.Path)
     8      ($.Page.Resources.Get $u.Path)
     9      (resources.Get $u.Path)
    10    -}}
    11      {{- $href = .RelPermalink -}}
    12      {{- with $u.RawQuery -}}
    13        {{- $href = printf "%s?%s" $href . -}}
    14      {{- end -}}
    15      {{- with $u.Fragment -}}
    16        {{- $href = printf "%s#%s" $href . -}}
    17      {{- end -}}
    18    {{- end -}}
    19  {{- end -}}
    20  {{- $attributes := dict "href" $href "title" .Title -}}
    21  <a
    22    {{- range $k, $v := $attributes -}}
    23      {{- if $v -}}
    24        {{- printf " %s=%q" $k $v | safeHTMLAttr -}}
    25      {{- end -}}
    26    {{- end -}}
    27    >{{ .Text | safeHTML }}</a>
    28  {{- /**/ -}}