diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2021-03-18 17:51:37 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2021-03-18 17:52:29 -0400 |
commit | d22bf423c1b82bd7ddb47ae1e3cb13f3ee270a0c (patch) | |
tree | 7ea249bab45436962187f0aec6ddd38912a98f74 /haunt/builder | |
parent | 5255259bf048b863e222c41dc406c91be1b2eba0 (diff) |
Create a unified type for build artifacts.
Deprecate <page> and <asset>.
Diffstat (limited to 'haunt/builder')
-rw-r--r-- | haunt/builder/atom.scm | 29 | ||||
-rw-r--r-- | haunt/builder/blog.scm | 13 |
2 files changed, 22 insertions, 20 deletions
diff --git a/haunt/builder/atom.scm b/haunt/builder/atom.scm index 2a6c356..acd74d4 100644 --- a/haunt/builder/atom.scm +++ b/haunt/builder/atom.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:use-module (sxml simple) + #:use-module (haunt artifact) #:use-module (haunt site) #:use-module (haunt post) #:use-module (haunt page) @@ -184,20 +185,20 @@ MAX-ENTRIES: The maximum number of posts to render in the feed" (build-uri (site-scheme site) #:host (site-domain site) #:path (string-append "/" file-name))))) - (make-page file-name - `(feed (@ (xmlns "http://www.w3.org/2005/Atom")) - (title ,(site-title site)) - (id ,uri) - (subtitle ,subtitle) - (updated ,(date->string* (current-date))) - (link (@ (href ,(string-append (site-domain site) - "/" file-name)) - (rel "self"))) - (link (@ (href ,(site-domain site)))) - ,@(map (cut post->atom-entry site <> - #:blog-prefix blog-prefix) - (take-up-to max-entries (filter posts)))) - sxml->xml*)))) + (serialized-artifact file-name + `(feed (@ (xmlns "http://www.w3.org/2005/Atom")) + (title ,(site-title site)) + (id ,uri) + (subtitle ,subtitle) + (updated ,(date->string* (current-date))) + (link (@ (href ,(string-append (site-domain site) + "/" file-name)) + (rel "self"))) + (link (@ (href ,(site-domain site)))) + ,@(map (cut post->atom-entry site <> + #:blog-prefix blog-prefix) + (take-up-to max-entries (filter posts)))) + sxml->xml*)))) (define* (atom-feeds-by-tag #:key (prefix "feeds/tags") diff --git a/haunt/builder/blog.scm b/haunt/builder/blog.scm index 2830881..4cf671f 100644 --- a/haunt/builder/blog.scm +++ b/haunt/builder/blog.scm @@ -27,6 +27,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-9) #:use-module (srfi srfi-19) + #:use-module (haunt artifact) #:use-module (haunt site) #:use-module (haunt post) #:use-module (haunt page) @@ -127,16 +128,16 @@ decorated by THEME, whose URLs start with PREFIX." (define (post->page post) (let ((base-name (string-append (site-post-slug site post) ".html"))) - (make-page (make-file-name base-name) - (render-post theme site post) - sxml->html))) + (serialized-artifact (make-file-name base-name) + (render-post theme site post) + sxml->html))) (define collection->page (match-lambda ((title file-name filter) - (make-page (make-file-name file-name) - (render-collection theme site title (filter posts) prefix) - sxml->html)))) + (serialized-artifact (make-file-name file-name) + (render-collection theme site title (filter posts) prefix) + sxml->html)))) (append (map post->page posts) (map collection->page collections)))) |