summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2017-05-25 13:34:32 +0200
committerFlorian Pelz <pelzflorian@pelzflorian.de>2017-05-25 13:34:32 +0200
commit9669880cce8a7ad9c852166ee748d55183220442 (patch)
tree87f6207516a892b7b0ebc43b02fa7e57b04365e4
parenta939d2f6b05ebc7f30e0bc79be91ae9a818a995a (diff)
Add tags to posts on main page as well.
-rw-r--r--haunt.scm39
1 files changed, 22 insertions, 17 deletions
diff --git a/haunt.scm b/haunt.scm
index d9b862c..a3ed50d 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -181,6 +181,26 @@
"index.html"))))
,(_ "See other posts"))))
+(define (tags-for-post-for-lingua post lingua)
+ (let ((tags (sort (post-ref post 'tags) string-ci<?))
+ (current-lingua lingua))
+ (if (not (null? tags))
+ `(div
+ ,(_ "Tags:")
+ ,@(map (lambda (tag)
+ `(span (@ (class "horizontally-padded"))
+ (a (@ (href
+ ,(build-url
+ (list
+ feeds-dir
+ current-lingua
+ (string-append
+ tag
+ ".xml")))))
+ ,tag)))
+ tags))
+ "")))
+
(define (build-url path-list)
(string-join path-list "/" 'prefix))
@@ -292,23 +312,7 @@
(h1 ,(post-ref post 'title))
(h2 ,(date->string-for-lingua (post-date post) current-lingua))
(div ,(post-sxml post))
- ,(let ((tags (sort (post-ref post 'tags) string-ci<?)))
- (if (not (null? tags))
- `(div
- ,(_ "Tags:")
- ,@(map (lambda (tag)
- `(span (@ (class "horizontally-padded"))
- (a (@ (href
- ,(build-url
- (list
- feeds-dir
- current-lingua
- (string-append
- tag
- ".xml")))))
- ,tag)))
- tags))
- ""))
+ ,(tags-for-post-for-lingua post current-lingua)
(div (@ (class "vertically-padded"))
,(recent-post-link-for-lingua current-lingua))
(div (@ (class "vertically-padded"))
@@ -394,6 +398,7 @@
(div
,(post-sxml most-recent-post)))
(div
+ ,(tags-for-post-for-lingua most-recent-post current-lingua)
,(recent-post-link-for-lingua current-lingua)))
""))) ; don’t print any posts if there are no posts yet
sxml->html)))))