You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
861 B
HTML
39 lines
861 B
HTML
{{ $params := . }}
|
|
|
|
{{ $page := $params.page }}
|
|
{{ $url := $params.url }}
|
|
|
|
{{ $result := "" }}
|
|
|
|
{{ if (urls.Parse $url).Scheme }}
|
|
{{ with resources.GetRemote $url }}
|
|
{{ with .Err }}
|
|
{{ errorf "layouts/partials/paige/resource.html: cannot get remote resource %q: %v" $url . }}
|
|
{{ else }}
|
|
{{ $result = . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if and (not $result) $page }}
|
|
{{ with $page.Resources.GetMatch $url }}
|
|
{{ $result = . }}
|
|
{{ else }}
|
|
{{ with $page.Resources.Get $url }}
|
|
{{ $result = . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if not $result }}
|
|
{{ with resources.GetMatch $url }}
|
|
{{ $result = . }}
|
|
{{ else }}
|
|
{{ with resources.Get $url }}
|
|
{{ $result = . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ return $result }}
|