Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'exampleSite/layouts/shortcodes/readfile.html')
-rw-r--r--exampleSite/layouts/shortcodes/readfile.html8
1 files changed, 8 insertions, 0 deletions
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