summaryrefslogtreecommitdiff
path: root/haunt.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-05-02 16:20:26 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-05-02 16:20:26 -0400
commit849efab76c602a2410fc3f4c946314ebb35c9d12 (patch)
treed8cf5d67f880e97246a1ffbef74261d11d8d6bfd /haunt.scm
parent7405049f201bfc26c840adb1937912b5ac06cc82 (diff)
Load static pages rather than inlining
Diffstat (limited to 'haunt.scm')
-rw-r--r--haunt.scm26
1 files changed, 8 insertions, 18 deletions
diff --git a/haunt.scm b/haunt.scm
index 05104ec..d171f98 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -53,23 +53,13 @@
(register-metadata-parser! 'date org-string->date)
-(define (static-page title file-name body)
+(define (static-page title slug)
(lambda (site posts)
- (make-page file-name
- (with-layout jakob-theme site title body)
- sxml->html)))
-
-(define about-page
- (static-page
- "About Me"
- "about.html"
- `((h2 "Hi."))))
-
-(define projects-page
- (static-page
- "Projects"
- "projects.html"
- `((h1 "Projects"))))
+ (let ((file-name (format #f "~a.html" slug))
+ (body (load (format #f "~a.scm" slug))))
+ (make-page file-name
+ (with-layout jakob-theme site title body)
+ sxml->html))))
(define %collections
`(("Recent Posts" "index.html" ,posts/reverse-chronological)))
@@ -87,8 +77,8 @@
(article-aliases %aliases)
(atom-feed)
(sort-by-tag)
- about-page
- projects-page
+ (static-page "About Me" "about")
+ (static-page "Projects" "projects")
(static-directory "css")
(static-directory "fonts")
(static-directory "images")))