diff options
Diffstat (limited to 'example/tpl/render_gemtext.html')
-rw-r--r-- | example/tpl/render_gemtext.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/example/tpl/render_gemtext.html b/example/tpl/render_gemtext.html new file mode 100644 index 0000000..0cfdec6 --- /dev/null +++ b/example/tpl/render_gemtext.html @@ -0,0 +1,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> |