diff options
author | Andreas Widen <andreas@harmonicflow.org> | 2023-11-25 17:21:37 +0100 |
---|---|---|
committer | Andreas Widen <andreas@harmonicflow.org> | 2023-11-25 17:21:37 +0100 |
commit | 1b2b7c3eb939724696894f31ff27db97b0cac84c (patch) | |
tree | efb7b7746a628efb7bb99b2e44c9c2fbfd75b656 /apps/media/builder.scm | |
download | hf-web-1b2b7c3eb939724696894f31ff27db97b0cac84c.tar.xz hf-web-1b2b7c3eb939724696894f31ff27db97b0cac84c.zip |
Initial commit.
Signed-off-by: Andreas Widen <andreas@harmonicflow.org>
Diffstat (limited to 'apps/media/builder.scm')
-rw-r--r-- | apps/media/builder.scm | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/apps/media/builder.scm b/apps/media/builder.scm new file mode 100644 index 0000000..a1a74a1 --- /dev/null +++ b/apps/media/builder.scm @@ -0,0 +1,69 @@ +;;; Harmonic Flow web site + +(define-module (apps media builder) + #:use-module (apps aux system) + #:use-module (apps base utils) + #:use-module (apps media data) + #:use-module (apps media templates screenshot) + #:use-module (apps media templates screenshots-overview) + #:use-module (apps media types) + #:use-module (haunt artifact) + #:use-module (haunt html) + #:use-module (haunt utils) + #:use-module (apps aux web) + #:use-module (srfi srfi-19) + #:export (builder)) + + +;;; +;;; Application builder. +;;; + +(define (builder site posts) + "Return the list of web resources that compose the app. + + This procedure is a Haunt builder procedure. + + SITE (<site>) + A site object that defines all the properties of the website. See + Haunt <site> objects for more information. + + POSTS (list of <post>) + A list of post objects that represent articles from the blog. See + Haunt <post> objects for more information. + + RETURN (list of <artifact> and <page>) + A list of objects that represent the web resources of the + application. See Haunt <artifact> and <page> objects for more + information." + (flatten + (list (screenshots-overview-builder) + (screenshots-builder) + ))) + + +;;; +;;; Helper builders. +;;; + + +(define (screenshots-builder) + "Return a list of Haunt pages representing screenshot pages." + (map + (lambda (shot) + (let ((context + (list (cons "screenshot" shot) + (cons "screenshots" screenshots)))) + (serialized-artifact (path-join "screenshots" + (screenshot-slug shot) + "index.html") + (screenshot-t context) + sxml->html))) + screenshots)) + + +(define (screenshots-overview-builder) + "Return a Haunt page representing the screenshots overview page." + (serialized-artifact "screenshots/index.html" + (screenshots-overview-t screenshots) + sxml->html))
\ No newline at end of file |