{- $errorlevel := or $page.Params.link.errorlevel $page.Site.Params.link.errorlevel }}
  {{- with $linkPage }}
    {{- $href = partial "permalink.gotmpl" (dict "to" .) }}
    {{- with $u.RawQuery }}
      {{- $href = printf "%s?%s" $href . }}
    {{- end }}
    {{- with $u.Fragment }}
      {{- $ctx := dict
        "contentPath" $page.File.Filename
        "errorLevel" $errorlevel
        "page" $linkPage
        "parsedURL" $u
        "renderHookName" "link"
      }}
      {{- partial "inline/h-rh-l/valida