summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/alias.scm12
-rw-r--r--haunt.scm7
2 files changed, 12 insertions, 7 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)))
diff --git a/haunt.scm b/haunt.scm
index 77c56af..75dfd24 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -194,8 +194,8 @@ free culture works available under the " ,%cc-by-sa-link " license.")
(email . "zerodaysfordays@sdf.lonestar.org"))
#:readers (list html-reader-prime)
#:builders (list (blog #:theme jakob-theme #:collections %collections)
+ (article-aliases %aliases)
(atom-feed)
- (atom-feeds-by-tag)
about-page
projects-page
(static-directory "css")
@@ -203,8 +203,3 @@ free culture works available under the " ,%cc-by-sa-link " license.")
(static-directory "images")
(lambda (site posts)
(map (lambda (alist)
- (let ((alias (car alist))
- (target (cdr alist)))
- (article-alias alias target)))
- %aliases))))
-