diff options
Diffstat (limited to 'themes/docsy/layouts/shortcodes/readfile.md')
-rw-r--r-- | themes/docsy/layouts/shortcodes/readfile.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/themes/docsy/layouts/shortcodes/readfile.md b/themes/docsy/layouts/shortcodes/readfile.md new file mode 100644 index 0000000..117c7e8 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/readfile.md @@ -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 -}} |