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/base/builder.scm | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 apps/base/builder.scm (limited to 'apps/base/builder.scm') diff --git a/apps/base/builder.scm b/apps/base/builder.scm new file mode 100644 index 0000000..4e1d194 --- /dev/null +++ b/apps/base/builder.scm @@ -0,0 +1,95 @@ +;;; Harmonic Flow web site + +(define-module (apps base builder) + #:use-module (apps base templates about) + #:use-module (apps base templates contact) + #:use-module (apps base templates hfge-about) + #:use-module (apps base templates hfge-download) + #:use-module (apps base templates hfge-git) + #:use-module (apps base templates home) + #:use-module (apps base templates menu) + #:use-module (apps base types) + #:use-module (apps blog utils) + #:use-module (apps media data) + #:use-module (haunt html) + #:use-module (haunt artifact) + #:use-module (haunt post) + #:use-module (haunt utils) + #:use-module (srfi srfi-1) + #: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 ) + A list of page objects that represent the web resources of the + application. See Haunt objects for more information." + (flatten + (list (menu-builder) + (home-builder site posts) + (about-builder) + (contact-builder) + (hfge-about-builder) + (hfge-download-builder) + (hfge-git-builder)))) + + + +;;; +;;; Helper builders. +;;; + + +(define (about-builder) + "Return a Haunt page representing the About page of the website." + (serialized-artifact "about/index.html" (about-t) sxml->html)) + + +(define (contact-builder) + "Return a Haunt page representing the Contact page of the website." + (serialized-artifact "contact/index.html" (contact-t) sxml->html)) + + +(define (hfge-about-builder) + "Return a Haunt page representing the HFGE about page of the website." + (serialized-artifact "hfge-about/index.html" (hfge-about-t) sxml->html)) + + +(define (hfge-download-builder) + "Return a Haunt page representing the HFGE download page of the website." + (serialized-artifact "hfge-download/index.html" (hfge-download-t) sxml->html)) + + +(define (hfge-git-builder) + "Return a Haunt page representing the HFGE git page of the website." + (serialized-artifact "hfge-git/index.html" (hfge-git-t) sxml->html)) + + +(define (home-builder site posts) + "Return a Haunt page representing the Home page of the website." + (let ((context + (list + (cons "screenshots" screenshots) + (cons "posts" (posts/latest posts 3)) + ))) + (serialized-artifact "index.html" (home-t context) sxml->html))) + + +(define (menu-builder) + "Return a Haunt page representing the website menu." + (serialized-artifact "menu/index.html" (menu-t) sxml->html)) -- cgit v1.2.3-54-g00ecf