From 11688d2da4ad3b3a148ca1eed5f4271afe0a687f Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sat, 3 Oct 2020 17:10:58 +0300 Subject: Add shortcode to allow importing slides in posts --- website/layouts/shortcodes/readpost.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 website/layouts/shortcodes/readpost.html diff --git a/website/layouts/shortcodes/readpost.html b/website/layouts/shortcodes/readpost.html new file mode 100644 index 0000000..5f80a27 --- /dev/null +++ b/website/layouts/shortcodes/readpost.html @@ -0,0 +1,10 @@ +{{$file := .Get "file"}} +{{$content := $file | readFile | replaceRE "^---[[:graph:][:space:]]*?---\n" "" }} + +{{- if eq (.Get "markdown") "true" -}} + {{- $content | markdownify -}} +{{- else if (.Get "highlight") -}} + {{- highlight ($content) (.Get "highlight") "" -}} +{{- else -}} + {{ $content | safeHTML }} +{{- end -}} -- cgit v1.3.1-23-gd82d