diff options
| Commit | 11688d2da4ad3b3a148ca1eed5f4271afe0a687f (patch) | |
|---|---|---|
| Author | 2020-10-03 17:10:58 +0300 | |
| Committer | 2020-10-04 08:19:36 +0300 | |
| Files | 1f3403d671f59cd04ae2aec57ebb9c02a852f624 | |
| IPL-11688d2da4ad3b3a148ca1eed5f4271afe0a687f.tar IPL-11688d2da4ad3b3a148ca1eed5f4271afe0a687f.tar.gz IPL-11688d2da4ad3b3a148ca1eed5f4271afe0a687f.zip | ||
| Parent | 022552ab0edee72120cab1bf6c48ae9ce0e5bd0e (diff) | |
Add shortcode to allow importing slides in posts
1 files changed, 10 insertions, 0 deletions
| -rw-r--r-- | website/layouts/shortcodes/readpost.html | 10 |
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 -}} |
