aboutsummaryrefslogtreecommitdiff
path: root/example/tpl/render_gemtext.html
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-07-04 17:36:48 +0200
committerBrian Picciano <me@mediocregopher.com>2024-07-04 17:36:48 +0200
commit0134492489ac70306486678aae81192d9cc0228d (patch)
treee8f3b2a922215c26bb6fa20cf104f54bc0e16aa1 /example/tpl/render_gemtext.html
parent4291fc5f1c992a499fbc82decc3fe8090d4dff68 (diff)
Split gemtext function output into Body and Title
Diffstat (limited to 'example/tpl/render_gemtext.html')
-rw-r--r--example/tpl/render_gemtext.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/example/tpl/render_gemtext.html b/example/tpl/render_gemtext.html
index 34a8c7c..72e35a4 100644
--- a/example/tpl/render_gemtext.html
+++ b/example/tpl/render_gemtext.html
@@ -2,13 +2,14 @@
{{ $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>TODO Title</title>
+ <title>{{ $gemtextRes.Title | default "Example Gemtext File" }}</title>
<link rel="stylesheet" type="text/css" href="/bamboo.css" />
</head>
<body>
- {{ gemtext (include $filePath) }}
+ {{ $gemtextRes.Body }}
</body>
</html>