hugo/docs/layouts/shortcodes/readfile.html
2018-02-21 10:02:51 +01:00

8 lines
No EOL
260 B
HTML

{{$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 -}}