mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
⚡ Chore: optimize .Resources variable acquisition in function resources.html
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
{{- $Resources := .Resources | default page.Resources -}}
|
||||
{{- $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 -}}
|
||||
{{- if $Resources -}}
|
||||
{{- with $Resources.GetMatch $url.Path -}}
|
||||
{{- $resource = . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user