diff options
Diffstat (limited to 'example/tpl')
-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> |