hugo-geekdoc/layouts/shortcodes/include.html

11 lines
336 B
HTML
Raw Normal View History

2020-04-30 13:37:27 +00:00
{{$file := .Get "file"}}
<div class="gdoc-include">
2020-04-30 13:37:27 +00:00
{{- if eq (.Get "markdown") "true" -}}
{{- $file | readFile | $.Page.RenderString -}}
2020-04-30 13:37:27 +00:00
{{- else if (.Get "language") -}}
{{- highlight ($file | readFile) (.Get "language") (default "linenos=table" (.Get "options")) -}}
{{- else -}}
{{ $file | readFile | safeHTML }}
2020-04-30 18:55:53 +00:00
{{- end -}}
</div>