commit 92811857431e49e1c22a468f5b2bfc55c3688ce3
parent 05c190cb618365216a876992fd8234f78a908d49
Author: Daniel Barlow <dan@telent.net>
Date: Sun, 27 Jul 2025 21:59:38 +0100
allow topics header in frontmatter
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/site.fnl b/site.fnl
@@ -106,6 +106,11 @@
(let [fields (frontmatter f)
title (or fields.subject fields.title)
slug (or fields.slug (slug-for title))
+ topics
+ (if fields.topics
+ (collect [w (string.gmatch fields.topics "(%g+)%G+")]
+ (values w w))
+ {})]
(values slug
(doto fields
(tset :path name)
@@ -113,6 +118,7 @@
(tset :url-path (.. "/" slug))
(tset :slug slug)
(tset :title title)
+ (tset :topics topics)
(tset :body-offset (f:seek :cur 0))
(tset :date (and fields.date (parse-timestamp fields.date)))))))))))