{{- $file := .Get "file" -}} {{- $codeLang := "" -}} {{- $suffix := findRE "(\\.[^.]+)$" $file 1 -}} {{- with $suffix -}} {{- $codeLang = (index . 0 | strings.TrimPrefix ".") -}} {{- end -}} {{- with .Get "codeLang" -}}{{- $codeLang = . -}}{{- end -}}
{{- with $file -}}
{{.}}
{{- end -}} {{- if ne (.Get "copy") "false" -}} {{- end -}}
{{ if .Get "nocode" }}{{ $.Inner }}{{ else }}{{ with $codeLang }}{{- highlight $.Inner . "" | -}}{{ else }}
{{- .Inner | string -}}
{{ end }}{{ end }}