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.

31 lines
703 B
HTML

{{ $page := .page }}
{{ $url := .url }}
{{ $resource := "" }}
{{ with $page.Resources.GetMatch $url }}
{{ $resource = . }}
{{ else }}
{{ with $page.Resources.Get $url }}
{{ $resource = . }}
{{ else }}
{{ with resources.GetMatch $url }}
{{ $resource = . }}
{{ else }}
{{ with resources.Get $url }}
{{ $resource = . }}
{{ else }}
{{ with resources.GetRemote $url }}
{{ $resource = . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not $resource }}
{{ errorf "invalid resource: %q" $url }}
{{ end }}
{{ return $resource }}