summaryrefslogtreecommitdiffstats
path: root/haunt.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-13 23:30:55 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-04-13 23:49:27 +0200
commit303a12092413c157272d78657d7c4d4c3f6b27b0 (patch)
tree2ead73262522aa159cf57c641fe9154282ddb9a0 /haunt.scm
parentroles: Add Ricardo for the web site. (diff)
software: Generate project list with member details.
* software.md: Replace this file... * software.sxml: ...with this new file. * haunt.scm (read-markdown-page): Rename this procedure... (read-page): ...to this procedure and add optional READER argument. (static-pages): Add local definition of SXML-PAGE and use it for software.sxml.
Diffstat (limited to 'haunt.scm')
-rw-r--r--haunt.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/haunt.scm b/haunt.scm
index d3b5a73..27594b3 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -127,10 +127,10 @@
127(define read-markdown 127(define read-markdown
128 (reader-proc commonmark-reader)) 128 (reader-proc commonmark-reader))
129 129
130(define (read-markdown-page file posts site) 130(define* (read-page file posts site #:optional (reader read-markdown))
131 "Read the CommonMark page from FILE. Return its final SXML 131 "Read the CommonMark page from FILE. Return its final SXML
132representation." 132representation."
133 (let ((meta body (read-markdown (string-append %cwd "/" file)))) 133 (let ((meta body (reader (string-append %cwd "/" file))))
134 (base-layout `(div (@ (class "post")) 134 (base-layout `(div (@ (class "post"))
135 (div (@ (class "post-body")) 135 (div (@ (class "post-body"))
136 ,body)) 136 ,body))
@@ -144,13 +144,19 @@ representation."
144 "Return the list of static web pages." 144 "Return the list of static web pages."
145 (define (markdown-page html md) 145 (define (markdown-page html md)
146 (lambda (site posts) 146 (lambda (site posts)
147 (make-page html (read-markdown-page md posts site) 147 (make-page html (read-page md posts site)
148 sxml->html)))
149 (define (sxml-page html sxml)
150 (lambda (site posts)
151 (make-page html (read-page sxml posts site (reader-proc sxml-reader))
148 sxml->html))) 152 sxml->html)))
149 153
150 (list (markdown-page "index.html" "index.md") 154 (list (markdown-page "index.html" "index.md")
151 155
152 (markdown-page "/en/software/index.html" 156 (sxml-page "/en/software/index.html"
153 "software.md") 157 "software.sxml")
158 (markdown-page "/en/documents/index.html"
159 "documents.md")
154 (markdown-page "/en/contribute/index.html" 160 (markdown-page "/en/contribute/index.html"
155 "contribute.md") 161 "contribute.md")
156 (markdown-page "/en/documents/index.html" 162 (markdown-page "/en/documents/index.html"
@@ -240,7 +246,7 @@ representation."
240 #:default-metadata 246 #:default-metadata
241 '((author . "The GNU Assembly") 247 '((author . "The GNU Assembly")
242 (email . "assembly@lists.gnu.tools")) 248 (email . "assembly@lists.gnu.tools"))
243 #:readers (list commonmark-reader) 249 #:readers (list commonmark-reader sxml-reader)
244 #:builders (append (list (static-directory "static")) 250 #:builders (append (list (static-directory "static"))
245 (static-pages) 251 (static-pages)
246 252