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/base/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/base/builder.scm')
-rw-r--r-- | apps/base/builder.scm | 95 |
1 files changed, 95 insertions, 0 deletions
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 (<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 <page>) + A list of page objects that represent the web resources of the + application. See Haunt <page> 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)) |