diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-06-16 14:02:59 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-06-16 14:02:59 -0400 |
| commit | 27ffd0a40e9ee8fddfd45a7b1372ce857fe440c1 (patch) | |
| tree | bebcb31996816b7ef1f6f0d961bd88efeacc25e8 | |
| parent | 70f28eb53f648a617d64c36b3d06c4020b5cdeef (diff) | |
Use the new `artifact' API instead of `make-page'
| -rw-r--r-- | haunt/jakob/builder/atom.scm | 28 | ||||
| -rw-r--r-- | haunt/jakob/builder/blog.scm | 26 | ||||
| -rw-r--r-- | haunt/jakob/builder/blogroll.scm | 18 | ||||
| -rw-r--r-- | haunt/jakob/builder/htaccess.scm | 4 | ||||
| -rw-r--r-- | haunt/jakob/builder/outbox.scm | 14 | ||||
| -rw-r--r-- | haunt/jakob/builder/static-pages.scm | 4 | ||||
| -rw-r--r-- | haunt/jakob/utils/pagination.scm | 16 |
7 files changed, 55 insertions, 55 deletions
diff --git a/haunt/jakob/builder/atom.scm b/haunt/jakob/builder/atom.scm index 81dd78e..f145443 100644 --- a/haunt/jakob/builder/atom.scm +++ b/haunt/jakob/builder/atom.scm @@ -15,8 +15,8 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder atom) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (haunt post) #:use-module (haunt site) #:use-module (haunt utils) @@ -94,16 +94,16 @@ add support for cross-posts. See the docstring in that manual for details on the use of this function." (lambda (site posts) - (make-page file-name - `(feed (@ (xmlns "http://www.w3.org/2005/Atom")) - (title ,(site-title site)) - (id ,(format-relative-path site file-name)) - (subtitle ,subtitle) - (updated ,(format-date (current-date))) - (link (@ (href ,(format-relative-path site file-name)) - (rel "self"))) - (link (@ (href ,(format-relative-path site "")))) - ,@(map (cut post->atom-entry site <> - #:blog-prefix blog-prefix) - (take-up-to max-entries (filter posts)))) - (@@ (haunt builder atom) sxml->xml*)))) + (serialized-artifact file-name + `(feed (@ (xmlns "http://www.w3.org/2005/Atom")) + (title ,(site-title site)) + (id ,(format-relative-path site file-name)) + (subtitle ,subtitle) + (updated ,(format-date (current-date))) + (link (@ (href ,(format-relative-path site file-name)) + (rel "self"))) + (link (@ (href ,(format-relative-path site "")))) + ,@(map (cut post->atom-entry site <> + #:blog-prefix blog-prefix) + (take-up-to max-entries (filter posts)))) + (@@ (haunt builder atom) sxml->xml*)))) diff --git a/haunt/jakob/builder/blog.scm b/haunt/jakob/builder/blog.scm index 0df5f50..e03c3e2 100644 --- a/haunt/jakob/builder/blog.scm +++ b/haunt/jakob/builder/blog.scm @@ -15,8 +15,8 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder blog) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (haunt post) #:use-module (haunt utils) #:use-module (ice-9 format) @@ -135,14 +135,14 @@ "Return a Haunt page for POST." (define meta-tags (call-with-input-string (post-ref post 'meta-tags) read)) (define scripts (call-with-input-string (post-ref post 'scripts) read)) - (make-page (post-uri post) - (theme #:title (post-ref post 'title) - #:description (description-from-post post) - #:keywords (post-ref post 'tags) - #:meta (if (not (eof-object? meta-tags)) meta-tags '()) - #:scripts (if (not (eof-object? scripts)) scripts '()) - #:content (render-article post)) - sxml->html)) + (serialized-artifact (post-uri post) + (theme #:title (post-ref post 'title) + #:description (description-from-post post) + #:keywords (post-ref post 'tags) + #:meta (if (not (eof-object? meta-tags)) meta-tags '()) + #:scripts (if (not (eof-object? scripts)) scripts '()) + #:content (render-article post)) + sxml->html)) ;;; @@ -173,10 +173,10 @@ only the posts tagged with that tag." (hyperlink (tag-uri %tag-prefix tag) `(li ,(format #f "~a (~a)" tag count))))) (count-tags posts (cut post-ref <> 'tags)))))) - (make-page "tag.html" - (theme #:title "All Tags" - #:content content) - sxml->html)) + (serialized-artifact "tag.html" + (theme #:title "All Tags" + #:content content) + sxml->html)) ;;; diff --git a/haunt/jakob/builder/blogroll.scm b/haunt/jakob/builder/blogroll.scm index 2e0f293..59ce221 100644 --- a/haunt/jakob/builder/blogroll.scm +++ b/haunt/jakob/builder/blogroll.scm @@ -15,8 +15,8 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder blogroll) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (haunt utils) #:use-module (ice-9 match) #:use-module (jakob theme) @@ -101,16 +101,16 @@ each tag is used." "Return a page listing ENTRIES in PREFIX with a header of TITLE, as well as pages for each of the tags used in ENTRIES." (cons - (make-page (string-append prefix "/index.html") - (theme #:title title - #:content (render-entries title prefix entries)) - sxml->html) + (serialized-artifact (string-append prefix "/index.html") + (theme #:title title + #:content (render-entries title prefix entries)) + sxml->html) (map (match-lambda ((tag . entries) - (make-page (tag-uri prefix tag) - (theme #:title title - #:content (render-entries title prefix entries tag)) - sxml->html))) + (serialized-artifact (tag-uri prefix tag) + (theme #:title title + #:content (render-entries title prefix entries tag)) + sxml->html))) (group-by-tag entries entry-tags)))) diff --git a/haunt/jakob/builder/htaccess.scm b/haunt/jakob/builder/htaccess.scm index 08aa786..77d50fe 100644 --- a/haunt/jakob/builder/htaccess.scm +++ b/haunt/jakob/builder/htaccess.scm @@ -15,7 +15,7 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder htaccess) - #:use-module (haunt page) + #:use-module (haunt artifact) #:use-module (ice-9 match) #:export (htaccess)) @@ -47,4 +47,4 @@ REDIRECTS specifies file names to show for certain requests: a list of (pattern redirects))) (lambda (site posts) - (make-page ".htaccess" contents htaccess-writer))) + (serialized-artifact ".htaccess" contents htaccess-writer))) diff --git a/haunt/jakob/builder/outbox.scm b/haunt/jakob/builder/outbox.scm index fcccc57..9bd5f75 100644 --- a/haunt/jakob/builder/outbox.scm +++ b/haunt/jakob/builder/outbox.scm @@ -15,8 +15,8 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder outbox) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (jakob theme) @@ -128,12 +128,12 @@ (define (reply->page reply) (let ((title (format #f "Reply to ~a" (reply-target-handle reply)))) - (make-page (reply-uri reply) - (theme #:title title - ;; #:description (first-paragraph post) - ;; #:keywords (post-ref post 'tags) - #:content (render-reply reply)) - sxml->html))) + (serialized-artifact (reply-uri reply) + (theme #:title title + ;; #:description (first-paragraph post) + ;; #:keywords (post-ref post 'tags) + #:content (render-reply reply)) + sxml->html))) ;;; diff --git a/haunt/jakob/builder/static-pages.scm b/haunt/jakob/builder/static-pages.scm index 48243cc..98817a6 100644 --- a/haunt/jakob/builder/static-pages.scm +++ b/haunt/jakob/builder/static-pages.scm @@ -15,8 +15,8 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob builder static-pages) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (ice-9 ftw) #:use-module (jakob builder blog) #:use-module (srfi srfi-1) @@ -33,7 +33,7 @@ (name (first (string-split (basename dest) #\.))) (sxml (primitive-load file-name)) (contents sxml)) - (cons (make-page dest contents sxml->html) memo)) + (cons (serialized-artifact dest contents sxml->html) memo)) (cons #f memo))) (define (noop file-name stat result) diff --git a/haunt/jakob/utils/pagination.scm b/haunt/jakob/utils/pagination.scm index f869897..f75f02f 100644 --- a/haunt/jakob/utils/pagination.scm +++ b/haunt/jakob/utils/pagination.scm @@ -21,8 +21,8 @@ ;;; Code: (define-module (jakob utils pagination) + #:use-module (haunt artifact) #:use-module (haunt html) - #:use-module (haunt page) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (jakob theme) @@ -104,11 +104,11 @@ the item from ITEMS passed as a parameter." (index->file-name (1+ index)) #f)) (enable-search (and enable-search (= index 1)))) - (make-page (index->file-name index) - (theme #:title title - #:content - (render-listing (map render-item subset) title - previous-page next-page - #:enable-search enable-search)) - sxml->html)))) + (serialized-artifact (index->file-name index) + (theme #:title title + #:content + (render-listing (map render-item subset) title + previous-page next-page + #:enable-search enable-search)) + sxml->html)))) (paginate items))) |