diff options
Diffstat (limited to 'custom/alias.scm')
| -rw-r--r-- | custom/alias.scm | 12 |
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))) |