aboutsummaryrefslogtreecommitdiff
path: root/content/index.html
blob: 26355a3face43a3fd7ca577d43a3a33fe472edbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{$pathParts := splitList "/" .OriginalReq.URL.Path}}
{{$markdownFilename := default "index" (slice $pathParts 2 | join "/")}}
{{$markdownFilePath := printf "/content/markdown/%s.md" $markdownFilename}}
{{if not (fileExists $markdownFilePath)}}{{httpError 404}}{{end}}
{{$markdownFile := (include $markdownFilePath | splitFrontMatter)}}
{{$title := default $markdownFilename $markdownFile.Meta.title}}
<!doctype html>
<html>
<head>
    {{ include "/include/head.html" }}
</head>
<body>
    <article>{{ markdown $markdownFile.Body }}</article>
</body> 
</html>