2024-10-22 19:35:10 +02:00
|
|
|
{{- $url := "" }}
|
2025-01-29 18:03:23 +01:00
|
|
|
{{- with .menu }}
|
|
|
|
{{- $errorlevel := or $.page.Params.link.errorlevel $.page.Site.Params.link.errorlevel }}
|
|
|
|
{{- if .PageRef }}
|
|
|
|
{{- with .Page }}
|
|
|
|
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
|
|
|
|
{{- else }}
|
2025-01-29 20:37:08 +01:00
|
|
|
{{- $msg := printf "%q: config menu link '%s' is not a page" $.page.File.Filename .PageRef }}
|
2025-01-29 22:17:39 +01:00
|
|
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .PageRef "page" $.page "param" "link" "msg" $msg) }}
|
2025-01-29 18:03:23 +01:00
|
|
|
{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
{{- with .URL }}
|
|
|
|
{{- $url = . | relLangURL }}
|
|
|
|
{{- $u := urls.Parse $url }}
|
|
|
|
{{- if $u.IsAbs }}
|
|
|
|
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" $.page "type" "menu link") $u.String }}
|
|
|
|
{{- else }}
|
2025-01-29 20:37:08 +01:00
|
|
|
{{- $msg := printf "%q: config menu link '%s' given by 'URL' is not verified; if it is a page use 'PageRef' instead" $.page.File.Filename . }}
|
2025-01-29 22:17:39 +01:00
|
|
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" . "page" $.page "param" "link" "msg" $msg) }}
|
2025-01-29 18:03:23 +01:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-10-22 19:35:10 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- return $url }}
|