]> git.jsancho.org Git - blog.git/commitdiff
Show tags in every post
authorJavier Sancho <jsf@jsancho.org>
Sun, 29 Jan 2017 19:36:40 +0000 (20:36 +0100)
committerJavier Sancho <jsf@jsancho.org>
Sun, 29 Jan 2017 19:36:40 +0000 (20:36 +0100)
haunt.scm

index 07b2a794a73f0c11131ac4c4ac3dbe04e0c68c00..068f123aa930d7535cf8b4931791c1dd0c95274d 100644 (file)
--- a/haunt.scm
+++ b/haunt.scm
                        " "
                        (li (a (@ (class "sc-rss") (target "_blank") (href "/feed.xml")) (i (@ (class "fa fa-rss")))))))))
               (main ,body))))
+
         #:post-template
         (lambda (post)
+          (define (get-tags post)
+            (or (assoc-ref (post-metadata post) 'tags) '()))
+
           `((article (@ (class "single"))
                      (header
                       (h1 ,(post-ref post 'title))
                       (p ,(date->string* (post-date post))))
                      ,(post-sxml post)
                      (div (@ (class "tag-cloud"))
-                          (p (a (@ (href "")) "prueba"))))))
+                          (p
+                           ,@(map (lambda (tag)
+                                    `((a (@ (href "")) ,tag) " "))
+                                  (get-tags post)))))))
+
          #:collection-template
          (lambda (site title posts prefix)
            (define (post-uri post)