summaryrefslogtreecommitdiff
path: root/src/operationnull/static.scm
blob: 25f35e28570ef9fe73fe89087b1658c50a0f00cd (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
(define-module (operationnull static)
  #:use-module (haunt artifact)
  #:use-module (haunt reader commonmark)
  #:use-module (haunt html)
  #:use-module (haunt builder blog)
  #:use-module (operationnull theme)
  #:export (static-page))


(define* (static-page page destination title
                      #:key
                      (theme main-theme)
                      (reader commonmark-reader))
  "Return a builder procedure that reads FILE into SXML, adjusts it
according to the THEME and serialize to HTML and put it to
build-directory of the site.  DESTINATION is a relative resulting file
path."
  (lambda (site posts)
    (list
     (serialized-artifact
      destination
      (with-layout theme site title page)
      sxml->html))))