From 9cfb91ab031046161ba8241e6e360d52b8f5ee5c Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Mon, 29 Apr 2019 19:36:42 -0400 Subject: Remove assumption that content is enclosed in
--- haunt.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'haunt.scm') diff --git a/haunt.scm b/haunt.scm index d7cb9b5..0fa918b 100644 --- a/haunt.scm +++ b/haunt.scm @@ -67,13 +67,12 @@ (define (first-paragraph post) (let loop ((sxml (post-sxml post)) (result '())) - (when (eqv? (car sxml) 'article) - (match (cdr sxml) - (() (reverse result)) - ((or (('p ...) _ ...) (paragraph _ ...)) - (reverse (cons paragraph result))) - ((head . tail) - (loop tail (cons head result))))))) + (match sxml + (() (reverse result)) + ((or (('p ...) _ ...) (paragraph _ ...)) + (reverse (cons paragraph result))) + ((head . tail) + (loop tail (cons head result)))))) (define %collections `(("Recent Blog Posts" "index.html" ,posts/reverse-chronological))) -- cgit v1.3