From 849efab76c602a2410fc3f4c946314ebb35c9d12 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Thu, 2 May 2019 16:20:26 -0400 Subject: Load static pages rather than inlining --- about.scm | 1 + haunt.scm | 26 ++++++++------------------ projects.scm | 1 + 3 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 about.scm create mode 100644 projects.scm diff --git a/about.scm b/about.scm new file mode 100644 index 0000000..c54f0bb --- /dev/null +++ b/about.scm @@ -0,0 +1 @@ +`((h2 "Hi.")) 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"))) diff --git a/projects.scm b/projects.scm new file mode 100644 index 0000000..c45a135 --- /dev/null +++ b/projects.scm @@ -0,0 +1 @@ +`((h1 "Projects")) -- cgit v1.3