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