diff options
author | Brian Picciano <me@mediocregopher.com> | 2024-11-01 13:00:18 +0100 |
---|---|---|
committer | Brian Picciano <me@mediocregopher.com> | 2024-11-01 13:00:18 +0100 |
commit | cf6af6def1cac3fc6cd044c82282208b7073eb64 (patch) | |
tree | 64d6186b5e30e1125c1eff6fa1d86a379e3d3693 /example/tpl/render_gemtext.html | |
parent | 246a99c28980e985bb4cff99042459bd5729cde1 (diff) |
Implement gemtext HTTP middleware
Diffstat (limited to 'example/tpl/render_gemtext.html')
-rw-r--r-- | example/tpl/render_gemtext.html | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/example/tpl/render_gemtext.html b/example/tpl/render_gemtext.html index 72e35a4..82d3c02 100644 --- a/example/tpl/render_gemtext.html +++ b/example/tpl/render_gemtext.html @@ -1,15 +1,10 @@ -{{ $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 }} -{{ $gemtextRes := gemtext (include $filePath) }} <!DOCTYPE html> <html> <head> - <title>{{ $gemtextRes.Title | default "Example Gemtext File" }}</title> + <title>{{ .Title | default "Example Gemtext File" }}</title> <link rel="stylesheet" type="text/css" href="/bamboo.css" /> </head> <body> - {{ $gemtextRes.Body }} + {{ .Body }} </body> </html> |