From 1d1010b21252e90781d28500e8e696500432522e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 21 Sep 2019 16:36:37 +0100 Subject: [PATCH] Add shortcode to read files --- content/_index.md | 6 +++++- layouts/shortcodes/read_file.html | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/read_file.html diff --git a/content/_index.md b/content/_index.md index 3217e5f..39be12c 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1 +1,5 @@ -# Snippets +--- +title: Snippets +--- + +{{% read_file "README.md" %}} diff --git a/layouts/shortcodes/read_file.html b/layouts/shortcodes/read_file.html new file mode 100644 index 0000000..661b984 --- /dev/null +++ b/layouts/shortcodes/read_file.html @@ -0,0 +1,4 @@ +{{ $file := resources.Get (.Get 0) }} + + +{{ $file.Content | safeHTML }}