aboutsummaryrefslogtreecommitdiff
path: root/content/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'content/index.html')
-rw-r--r--content/index.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/content/index.html b/content/index.html
new file mode 100644
index 0000000..26355a3
--- /dev/null
+++ b/content/index.html
@@ -0,0 +1,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> \ No newline at end of file