diff options
author | Brian Picciano <me@mediocregopher.com> | 2024-07-04 12:33:45 +0200 |
---|---|---|
committer | Brian Picciano <me@mediocregopher.com> | 2024-07-04 12:33:45 +0200 |
commit | 4291fc5f1c992a499fbc82decc3fe8090d4dff68 (patch) | |
tree | 2516d5245bf35ae5f99b69a84a72280bb02ff3e9 /example/tpl/render_gemtext.html | |
parent | 8d0b8d388b31050468362710078feb39ece802ed (diff) |
Improve and clean up the example config for templates
Diffstat (limited to 'example/tpl/render_gemtext.html')
-rw-r--r-- | example/tpl/render_gemtext.html | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/example/tpl/render_gemtext.html b/example/tpl/render_gemtext.html index 0cfdec6..34a8c7c 100644 --- a/example/tpl/render_gemtext.html +++ b/example/tpl/render_gemtext.html @@ -1,7 +1,6 @@ -{{ $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" }} +{{ $pathSplit := splitList "/" .Req.URL.Path }} +{{ $base := last $pathSplit | default "index.gmi" }} +{{ $filePath := append (initial $pathSplit) $base | join "/" | printf "static%s" }} {{ if not (fileExists $filePath) }}{{ httpError 404 }}{{ end }} <!DOCTYPE html> <html> |