X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=haunt.scm;h=883de22d3020157f18e60c0206a79bdfe55cac6b;hb=ac013fe704cd5cbf866237203d5e166b431391a6;hp=5a0a077ee21f3cdd1ad84bcd44f062b4b28f544d;hpb=6dc70c80ff48362ea181c299415a8ebb5838f104;p=blog.git diff --git a/haunt.scm b/haunt.scm index 5a0a077..883de22 100644 --- a/haunt.scm +++ b/haunt.scm @@ -33,9 +33,13 @@ `(" " (span (@ (style "margin: 0 3px")) ⦿) (span (@ (class "tags")) - ,@(map (lambda (tag) - `((a (@ (href ,(format #f "tags/~a.html" tag))) ,tag) " ")) - tags))))) + ,@(drop-right + (apply + append + (map (lambda (tag) + `((a (@ (href ,(format #f "tags/~a.html" tag))) ,tag) ", ")) + tags)) + 1))))) (else div)))) @@ -86,10 +90,14 @@ (site-post-slug site post) ".html")) (define (get-paragraphs sxml count) - (let ((pars (filter - (lambda (e) (and (pair? e) (eq? (car e) 'p))) - sxml))) - (list-head pars (min count (length pars))))) + (define (getp sxml count res) + (cond ((or (= count 0) (null? sxml)) + res) + ((and (pair? (car sxml)) (eq? (caar sxml) 'p)) + (getp (cdr sxml) (- count 1) (cons (car sxml) res))) + (else + (getp (cdr sxml) count (cons (car sxml) res))))) + (reverse (getp sxml count '()))) (define (post-summary post) (or (post-ref post 'summary)