X-Git-Url: https://git.jsancho.org/?p=blog.git;a=blobdiff_plain;f=haunt.scm;h=c594fd9548e9e0d48c690511f1bed746990fec5e;hp=70247b9d16da3094386fb414d935cf1398e404bb;hb=2021774b6c6b93b6260eb4ef07b68cefda1d5b92;hpb=4847e2c26207bfcf6a0a453782550966ce7b1827 diff --git a/haunt.scm b/haunt.scm index 70247b9..c594fd9 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)))) @@ -51,6 +55,7 @@ (link (@ (rel "stylesheet") (href "https://fonts.googleapis.com/css?family=Merriweather+Sans:400,300,300italic,400italic,700,700italic,800,800italic|Merriweather:400,300,300italic,400italic,700,700italic,900,900italic|Source+Code+Pro:200,300,400,500,600,700,900"))) ,(stylesheet "application.min") ,(stylesheet "pygments.min") + ,(stylesheet "custom") (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0")))) (body ,(let ((metadata (site-default-metadata site))) @@ -84,10 +89,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)