1ace505d27
BREAKING CHANGE: The include shortcode will render files as Markdown instead of HTML by default now. While the Markdown renderer should be able to render HTML as well this might still work as before. BREAKING CHANGE: The include shortcode option markdown was replaces by a generic type option that could be used to specify special include types.
17 lines
532 B
HTML
17 lines
532 B
HTML
{{ $file := .Get "file" }}
|
|
{{ $page := .Site.GetPage $file }}
|
|
{{ $type := .Get "type" }}
|
|
{{ $language := .Get "language" }}
|
|
{{ $options :=.Get "options" }}
|
|
|
|
<div class="gdoc-include">
|
|
{{- if (.Get "language") -}}
|
|
{{- highlight ($file | readFile) $language (default "linenos=table" $options) -}}
|
|
{{- else if eq $type "html" -}}
|
|
{{- $file | readFile | safeHTML -}}
|
|
{{- else if eq $type "page" -}}
|
|
{{- with $page }}{{ .Content }}{{ end -}}
|
|
{{- else -}}
|
|
{{- $file | readFile | $.Page.RenderString -}}
|
|
{{- end -}}
|
|
</div>
|