bobatheme/layouts/shortcodes/include.html

21 lines
473 B
HTML
Raw Permalink Normal View History

2023-01-23 17:39:20 -06:00
{{ $path := "" }}
{{ $markdown := false }}
{{ if .IsNamedParams }}
{{ $path = .Get "path" }}
{{ with .Get "markdown" }}
{{ $markdown = . }}
{{ end }}
{{ else }}
{{ $path = .Get 0 }}
{{ end }}
{{ with ($path | readFile) }}
{{ if $markdown }}
{{ $path | readFile | $.Page.RenderString (dict "display" "block") }}
{{ else }}
{{ $path | readFile }}
{{ end }}
2023-01-23 17:39:20 -06:00
{{ else }}
{{ errorf "file not found: %s" $path }}
2023-01-23 17:39:20 -06:00
{{ end }}