2021-02-21 14:27:54 +01:00
|
|
|
{{ $file := .Get "file" }}
|
2021-04-10 13:55:03 +02:00
|
|
|
{{ $page := .Site.GetPage $file }}
|
|
|
|
{{ $type := .Get "type" }}
|
|
|
|
{{ $language := .Get "language" }}
|
|
|
|
{{ $options :=.Get "options" }}
|
|
|
|
|
2022-01-06 13:58:10 +01:00
|
|
|
|
2020-06-02 21:28:52 +02:00
|
|
|
<div class="gdoc-include">
|
2022-01-06 13:58:10 +01:00
|
|
|
{{- if (.Get "language") -}}
|
2021-04-10 13:55:03 +02:00
|
|
|
{{- highlight ($file | readFile) $language (default "linenos=table" $options) -}}
|
2022-01-06 13:58:10 +01:00
|
|
|
{{- else if eq $type "html" -}}
|
2021-04-10 13:55:03 +02:00
|
|
|
{{- $file | readFile | safeHTML -}}
|
2022-01-06 13:58:10 +01:00
|
|
|
{{- else if eq $type "page" -}}
|
2021-04-10 13:55:03 +02:00
|
|
|
{{- with $page }}{{ .Content }}{{ end -}}
|
2022-01-06 13:58:10 +01:00
|
|
|
{{- else -}}
|
2021-04-10 13:55:03 +02:00
|
|
|
{{- $file | readFile | $.Page.RenderString -}}
|
2022-01-06 13:58:10 +01:00
|
|
|
{{- end -}}
|
2020-06-02 21:28:52 +02:00
|
|
|
</div>
|