mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-09 23:00:42 +00:00
19 lines
544 B
HTML
19 lines
544 B
HTML
{{ $file := .Get "file" }}
|
|
{{ $page := .Site.GetPage $file }}
|
|
{{ $type := .Get "type" }}
|
|
{{ $language := .Get "language" }}
|
|
{{ $options :=.Get "options" }}
|
|
|
|
|
|
<div class="gblog-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>
|