blob: 4e1d194edfaffda443c6768398a830273729f6ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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))
|