aboutsummaryrefslogtreecommitdiff
path: root/example/tpl/render_gemtext.html
blob: 0cfdec6703507c2fc7c051445f3bb31d81e92f20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{ $pathSplit := splitList "/" .OriginalReq.URL.Path }}
{{ $base := last $pathSplit | default "index.html" }}
{{ $newBase := trimSuffix (ext $base) $base | printf "%s.gmi" }}
{{ $filePath := append (initial $pathSplit) $newBase | join "/" | printf "static%s" }}
{{ if not (fileExists $filePath) }}{{ httpError 404 }}{{ end }}
<!DOCTYPE html>
<html>
  <head>
    <title>TODO Title</title>
    <link rel="stylesheet" type="text/css" href="/bamboo.css" />
  </head>
  <body>
    {{ gemtext (include $filePath) }}
  </body>
</html>