mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
19 lines
512 B
HTML
19 lines
512 B
HTML
{{- $Resources := .Resources | default page.Resources -}}
|
|
{{- $resource := 0 -}}
|
|
{{- $url := urls.Parse .Path -}}
|
|
{{- if not (partial "function/is-url-remote.html" $url) -}}
|
|
{{- $dest := strings.TrimPrefix "./" $url.Path -}}
|
|
{{- if $Resources -}}
|
|
{{- with $Resources.GetMatch $dest -}}
|
|
{{- $resource = . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if not $resource -}}
|
|
{{- with resources.Get $dest -}}
|
|
{{- $resource = . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- return $resource -}}
|