From b6811d23266cf804ea58919ab85e6aec4be7b7e7 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Sat, 28 Dec 2019 21:35:20 -0500 Subject: Refactor SXML generation with a reader macro. --- haunt/jakob/builder/blogroll.scm | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'haunt/jakob/builder/blogroll.scm') diff --git a/haunt/jakob/builder/blogroll.scm b/haunt/jakob/builder/blogroll.scm index 9d75c1e..866ee2b 100644 --- a/haunt/jakob/builder/blogroll.scm +++ b/haunt/jakob/builder/blogroll.scm @@ -83,22 +83,19 @@ each tag is used." (define* (render-entries title prefix entries #:optional tag) "Return an SHTML document listing ENTRIES in PREFIX, with a header of TITLE." - `(main - ,@(maybe-cons* - `(h1 ,(if tag - (format #f "~a - Tagged with \"~a\"" title tag) - title)) - (unless tag - (render-tag-cloud prefix entries)) - (unless tag - `(hr)) - (map (lambda (entry) - (render-preview (entry-name entry) - (entry-uri entry) - (entry-tags entry) - prefix - (entry-comments entry))) - entries)))) + #<(main + `(h1 ,(if tag + (format #f "~a - Tagged with \"~a\"" title tag) + title)) + ,(unless tag (render-tag-cloud prefix entries)) + ,(unless tag `(hr)) + ,@(map (lambda (entry) + (render-preview (entry-name entry) + (entry-uri entry) + (entry-tags entry) + prefix + (entry-comments entry))) + entries))) (define (entries->pages title prefix entries) "Return a page listing ENTRIES in PREFIX with a header of TITLE, as well as -- cgit v1.3