aboutsummaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-05-02 10:40:37 -0400
committerJakob L. Kreuze2019-05-02 10:49:11 -0400
commit5d4678d7061c38409ea4ab8f5f3d069d5729ce22 (patch)
tree58208098f925a3d63c7268fc10c2b4338cafac8a /custom
parentf9e38be6c95594e9642e2530e2aa0286cff5a00f (diff)
Abstract away the aliases builder
Diffstat (limited to 'custom')
-rw-r--r--custom/alias.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/custom/alias.scm b/custom/alias.scm
index fde03c7..6bc5062 100644
--- a/custom/alias.scm
+++ b/custom/alias.scm
@@ -17,7 +17,7 @@
(define-module (custom alias)
#:use-module (haunt html)
#:use-module (haunt page)
- #:export (article-alias))
+ #:export (article-aliases))
(define (article-alias alias target)
"Create a page named ALIAS that redirects to TARGET."
@@ -32,3 +32,13 @@
(meta (@ (http-equiv "refresh")
(content ,(string-append "0; " target)))))))
sxml->html))
+
+(define (article-aliases aliases)
+ "Return a procedure that transforms a list of article ALIASES into pages
+redirecting from one arbitrary file to another."
+ (lambda (site posts)
+ (map (lambda (alist)
+ (let ((alias (car alist))
+ (target (cdr alist)))
+ (article-alias alias target)))
+ aliases)))

© 2015 - 2026 Jakob L. Kreuze