{{ $s := newScratch }} {{ $s.Set "file" (.Get 0) }} {{ if not ( path.Ext ($s.Get "file")) }} {{ $s.Set "file" (print ($s.Get "file") ".md") }} {{ end }} {{ if not ( fileExists ($s.Get "file")) }} {{ $s.Set "file" (print ( .Site.Params.extraContentDir | default "content_common") "/" ($s.Get "file")) }} {{ end }}
{{ if fileExists ($s.Get "file") }} {{ ($s.Get "file") | readFile | replaceRE "^---[\\s\\S]+?---" "" | markdownify }} {{ else }} Error file: {{ ($s.Get "file") }} not found {{ end }}