Throw error in include shortcode if file not found

This commit is contained in:
BBaoVanC 2023-10-16 20:35:05 -05:00
parent 0ddf0bdf42
commit 289f55dc19
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -9,9 +9,12 @@
{{ $path = .Get 0 }} {{ $path = .Get 0 }}
{{ end }} {{ end }}
{{ with ($path | readFile) }}
{{ if $markdown }} {{ if $markdown }}
{{ $path | readFile | .Page.RenderString (dict "display" "block") }} {{ $path | readFile | $.Page.RenderString (dict "display" "block") }}
{{ else }} {{ else }}
{{ $path | readFile }} {{ $path | readFile }}
{{ end }} {{ end }}
{{ else }}
{{ errorf "file not found: %s" $path }}
{{ end }}