X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=haunt.scm;h=3554f3594aa3319bbfa21efabc0b22fcafa6e2ae;hb=e93ca35626edc34b10510317fa259ca5186bcbc5;hp=6c83826d22cb41041707a970945c299a1f7289e8;hpb=3ae82e7780aeacd88854dba6294732a9d6f62257;p=blog.git diff --git a/haunt.scm b/haunt.scm index 6c83826..3554f35 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)))) @@ -63,7 +67,7 @@ (a (@ (href "index.html")) (h1 ,(assoc-ref metadata 'author))))) (ul (@ (class "navigation-items center")) - (li (a (@ (href "https://jsancho.org/")) "in spanish"))) + (li (a (@ (href "https://www.jsancho.org/")) "in spanish"))) (ul (@ (class "navigation-items right")) ,@(map (lambda (page) `(li (a (@ (href ,(cdr page))) ,(car page)))) @@ -86,14 +90,18 @@ (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) - (get-paragraphs (cdr (post-sxml post)) 3))) + (get-paragraphs (cdar (post-sxml post)) 3))) `( ,@(map (lambda (post)