From e781be1620c1f5f16044f035c265b937ba4971a7 Mon Sep 17 00:00:00 2001 From: Victoria Drake Date: Sat, 25 Jul 2020 09:38:23 -0400 Subject: Add example site configuration post, shortcodes - Hopefully help explain related issues #217, #194 Close #226 --- exampleSite/layouts/shortcodes/md.html | 1 + exampleSite/layouts/shortcodes/readfile.html | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 exampleSite/layouts/shortcodes/md.html create mode 100644 exampleSite/layouts/shortcodes/readfile.html (limited to 'exampleSite/layouts') diff --git a/exampleSite/layouts/shortcodes/md.html b/exampleSite/layouts/shortcodes/md.html new file mode 100644 index 0000000..ed3fb8a --- /dev/null +++ b/exampleSite/layouts/shortcodes/md.html @@ -0,0 +1 @@ +{{.Inner}} \ No newline at end of file diff --git a/exampleSite/layouts/shortcodes/readfile.html b/exampleSite/layouts/shortcodes/readfile.html new file mode 100644 index 0000000..36400ac --- /dev/null +++ b/exampleSite/layouts/shortcodes/readfile.html @@ -0,0 +1,8 @@ +{{$file := .Get "file"}} +{{- if eq (.Get "markdown") "true" -}} +{{- $file | readFile | markdownify -}} +{{- else if (.Get "highlight") -}} +{{- highlight ($file | readFile) (.Get "highlight") "" -}} +{{- else -}} +{{ $file | readFile | safeHTML }} +{{- end -}} \ No newline at end of file -- cgit v1.2.3