{{ $file := .Get "file" }} {{ $.Scratch.Set "codeLang" "" }} {{ $suffix := findRE "(\\.[^.]+)$" $file 1 }} {{ with $suffix }} {{ $.Scratch.Set "codeLang" (index . 0 | strings.TrimPrefix ".") }} {{ end }} {{ with .Get "codeLang" }}{{ $.Scratch.Set "codeLang" . }}{{ end }}
{{- with $file -}}
{{.}}
{{- end -}} {{ if ne (.Get "copy") "false" }} {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} {{end}}
{{ if .Get "nocode" }}{{ $.Inner }}{{ else }}{{ with $.Scratch.Get "codeLang" }}{{- highlight $.Inner . "" | -}}{{ else }}
{{- .Inner | string -}}
{{ end }}{{ end }}