Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 10 insertions, 0 deletions
-rw-r--r--website/layouts/shortcodes/readpost.html10
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 -}}