mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 10:56:16 +01:00
16 lines
472 B
HTML
16 lines
472 B
HTML
{{- $resource := 0 -}}
|
|
{{- $url := urls.Parse .Path -}}
|
|
{{- if not $url.Host | and $url.Path | and (strings.HasSuffix $url.Path "/" | not) -}}
|
|
{{- if .Resources -}}
|
|
{{- with .Resources.GetMatch $url.Path -}}
|
|
{{- $resource = . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if not $resource -}}
|
|
{{- with resources.Get $url.Path -}}
|
|
{{- $resource = . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- return $resource -}}
|