1 | 1 |
(declare (uses libs))
|
2 | 2 |
(declare (uses telml))
|
| 3 |
(declare (uses match-case-simple))
|
3 | 4 |
|
4 | |
; (require-extension scss)
|
5 | |
; (require-extension sxml-serializer)
|
6 | |
; (require-extension matchable)
|
| 5 |
; (load "libs.scm")
|
| 6 |
; (load "telml.scm")
|
| 7 |
; this is just Oleg's pattern matcher
|
| 8 |
; (load "match-case-simple.scm")
|
7 | 9 |
|
8 | |
(load "libs.scm")
|
9 | |
(load "telml.scm")
|
10 | |
|
11 | |
(define (pairs lst)
|
12 | |
(if (or (null? lst) (null? (cdr lst))) '()
|
13 | |
(cons (list (car lst) (cadr lst)) (cddr lst))))
|
| 10 |
;(define (pairs lst)
|
| 11 |
; (match-case-simple lst
|
| 12 |
; [(,x . (,y . ,xs)) () (cons (list x y) (pairs xs))]
|
| 13 |
; [__ () '()]))
|
14 | 14 |
|
15 | 15 |
;; template-ey things and style things
|
16 | 16 |
|
|
120 | 120 |
(title (if meta (cadr meta) pg)))
|
121 | 121 |
(display (serialize-sxml (page title telml)))))
|
122 | 122 |
|
123 | |
(apply main (command-line-arguments))
|
| 123 |
(define (dispatch page file)
|
| 124 |
(cond ((equal? page "index")
|
| 125 |
(with-output-to-file "output/index.html"
|
| 126 |
(lambda () (main "index" file))))
|
| 127 |
((equal? page "post")
|
| 128 |
(with-output-to-file "output/post.html"
|
| 129 |
(lambda () (main "post" file))))
|
| 130 |
((equal? page "tag")
|
| 131 |
(with-output-to-file "output/tags/index.html"
|
| 132 |
(lambda () (main "tags" file))))
|
| 133 |
((equal? page "about")
|
| 134 |
(with-output-to-file "output/about/index.html"
|
| 135 |
(lambda () (main "about" "pages/about.telml"))))))
|
| 136 |
|
| 137 |
(define args (command-line-arguments))
|
| 138 |
(format #t "got: ~a\n" args)
|
| 139 |
(apply dispatch args)
|