diff options
Diffstat (limited to '')
-rw-r--r-- | haunt.scm | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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 |
132 | representation." | 132 | representation." |
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 | ||