commit 74fffc50ee7d14884135448a7a51320f32a8daa4
parent fff0e46c881ebacf6c73dfea328a5895d95eb371
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 22 Jul 2025 22:24:26 +0100
split page and post headers so we can top & tail the search pages
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/main.fnl b/main.fnl
@@ -95,23 +95,29 @@
(string.match pathname "%.txt$") "text/plain"
"application/octet-stream"))
-(fn post-header [post stream]
+(fn page-header [stream title]
(stream:write_chunk
(string.format
"<html><head><link href=\"/static/css/default.css\" rel=\"stylesheet\"><link href=\"/news.rss\" rel=\"alternate\" title=\"RSS\" type=\"application/rss+xml\"><title>%s @ telent</title></head>
<body>
<header><a href=\"/\"><div class=\"title\">diary @ telent</div></a></header>
-<article><div class=\"entry\">
+<article>"
+ title)))
+
+(fn post-header [post stream]
+ (page-header stream post.title)
+ (stream:write_chunk
+ (string.format
+ "<div class=\"entry\">
<h1 class=\"title\">%s<span class=\"permalink\"><a href=%q>#</a></span></h1>
<h2 class=\"date\">%s</h2>
"
post.title
- post.title
post.url-path
(os.date "%c" post.date)
)))
-(fn post-footer [post stream]
+(fn page-footer [stream]
(stream:write_chunk
"<footer><div>Powered by <a href=\"https://gti.telent.net/dan/cripslock\">cripslock</a>. Copyright © 2001-2025 Daniel Barlow</div></footer></body></html>"))
@@ -182,7 +188,7 @@ in the Fediverse at <a href=\"https://axillae.telent.net/\">@dan@axillae.telent.
false)
)))
(sidebar post-index stream)
- (post-footer post stream)
+ (page-footer stream)
(stream:write_chunk "" true))
:sendfile
(with-open [f (io.open route.pathname :r)]
diff --git a/textile.fnl b/textile.fnl
@@ -146,7 +146,7 @@
(expect= (inline-markup "I have - and this is an aside - no strikethrough")
["I have - and this is an aside - no strikethrough"])
-
+
(expect= (inline-markup "foo@example.com") ["foo@example.com" ])
(expect= (inline-markup "foo @ example.com") ["foo @ example.com" ])