summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-11-18 20:46:36 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-11-18 20:46:36 -0500
commit51e2f10645441ded9dbc181cf465cc902c8e1b5d (patch)
treefe3bd62b8d9154d2734ad1fd6b7956354a0e9a86
parentea14e56f0cec5e1bc0ba86f37e6cc0860cdec11a (diff)
post: Add post-ref-all procedure.
* haunt/post.scm (post-ref-all): New procedure.
-rw-r--r--haunt/post.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/haunt/post.scm b/haunt/post.scm
index 2b97629..0a0bb8d 100644
--- a/haunt/post.scm
+++ b/haunt/post.scm
@@ -36,6 +36,7 @@
post-sxml
post-metadata
post-ref
+ post-ref-all
post-slug
%default-date
post-date
@@ -57,6 +58,13 @@
"Return the metadata corresponding to KEY within POST."
(assq-ref (post-metadata post) key))
+(define (post-ref-all post key)
+ "Return a list of all metadata values for KEY within POST."
+ (filter-map (match-lambda
+ ((k . v)
+ (and (eq? key k) v)))
+ (post-metadata post)))
+
(define char-set:slug
(char-set-union char-set:letter+digit (char-set #\-)))