Fix shortcodes to enable complex nesting

This commit is contained in:
Will Faught
2023-04-25 19:16:55 -07:00
parent b06903d6c0
commit a9d822a156
10 changed files with 50 additions and 31 deletions

View File

@@ -1,4 +1,7 @@
{{ $url := . }}
{{ $params := . }}
{{ $page := $params.page }}
{{ $url := $params.url }}
{{ $result := "" }}
@@ -12,11 +15,11 @@
{{ end }}
{{ end }}
{{ if and (not $result) page }}
{{ with page.Resources.GetMatch $url }}
{{ if and (not $result) $page }}
{{ with $page.Resources.GetMatch $url }}
{{ $result = . }}
{{ else }}
{{ with page.Resources.Get $url }}
{{ with $page.Resources.Get $url }}
{{ $result = . }}
{{ end }}
{{ end }}