Add include shortcode

This commit is contained in:
BBaoVanC 2023-01-23 17:39:20 -06:00
parent 60ed1c0264
commit 1f8a82228e
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -0,0 +1,17 @@
{{ $path := "" }}
{{ $markdown := false }}
{{ if .IsNamedParams }}
{{ $path = .Get "path" }}
{{ with .Get "markdown" }}
{{ $markdown = . }}
{{ end }}
{{ else }}
{{ $path = .Get 0 }}
{{ end }}
{{ if $markdown }}
{{ $path | readFile | markdownify }}
{{ else }}
{{ $path | readFile }}
{{ end }}