From 1b2b7c3eb939724696894f31ff27db97b0cac84c Mon Sep 17 00:00:00 2001 From: Andreas Widen Date: Sat, 25 Nov 2023 17:21:37 +0100 Subject: Initial commit. Signed-off-by: Andreas Widen --- apps/media/builder.scm | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 apps/media/builder.scm (limited to 'apps/media/builder.scm') 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 () + A site object that defines all the properties of the website. See + Haunt objects for more information. + + POSTS (list of ) + A list of post objects that represent articles from the blog. See + Haunt objects for more information. + + RETURN (list of and ) + A list of objects that represent the web resources of the + application. See Haunt and 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 -- cgit v1.2.3-54-g00ecf