summary refs log tree commit diff stats
path: root/lib/config.sld
blob: f2c00dfc176704ae81d6792127fc2b0e38d4d5e5 (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
;;; (boudin config) --- default values for configuration options
;;
;; To change these, make a `config.scm' in your site's root directory and change
;; these.  They're all parameters so .. change em like that.

(define-library (boudin config)
  (import (scheme base)
          (boudin schmaltz)
          ;; not portable
          (chicken pathname)
          (chicken time posix)
          (html-parser)
          )

  (export site-url site-dest
          page-path-transformers page-text-transformers
          page-date-formats
          page-template index-template feed-template
          build-time)

  (begin
    ;; Site information
    (define site-url
      (make-parameter "example.com"))
    (define site-dest
      (make-parameter "out/"))
    ;; Transformers
    (define page-path-transformers
      (make-parameter
       (list (lambda (path) (make-pathname (site-dest) path)))))
    (define page-text-transformers
      (make-parameter
       (list wrap-paragraphs
             render-string
             html->sxml)))
    ;; Templates --- note that we use quote but include unquote forms here.
    ;; This is to simplify the configuration and to avoid a cyclical dependency
    ;; with (boudin types).
    (define page-template
      (make-parameter
       '(html (@ (lang "en-us"))
              (head (title (or (page-ref pg "title") "[untitled]")))
              (body ,@(page-sxml pg)))))
    (define index-template
      (make-parameter 'todo))
    (define feed-template
      (make-parameter 'todo))
    ;; Miscellaneous
    (define page-date-formats
      (make-parameter (list "%Y-%m-%d"
                            "%Y-%m-%d%n%H:%M"
                            "%Y-%m-%d%n%I:%M%n%p")))
    ;; Not actually configuration, but state ... meh
    (define build-time
      (make-parameter
       (time->string (seconds->utc-time) "%FT%TZ"))))
    )