18 lines
491 B
HTML
18 lines
491 B
HTML
{{- $resource := 0 -}}
|
|
{{- $url := urls.Parse .Path -}}
|
|
{{- if not (partial "function/isUrlRemote.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 -}}
|