cullmann.io/themes/LoveIt/layouts/partials/function/resource.html

17 lines
472 B
HTML
Raw Normal View History

2021-02-18 21:44:01 +01:00
{{- $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 -}}