From 1f8a82228ef94a18948b3dce8b3660bde5948608 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 23 Jan 2023 17:39:20 -0600 Subject: [PATCH] Add include shortcode --- layouts/shortcodes/include.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 layouts/shortcodes/include.html diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html new file mode 100644 index 0000000..ae24c26 --- /dev/null +++ b/layouts/shortcodes/include.html @@ -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 }}