Compare commits

2 Commits

Author SHA1 Message Date
thintz
659a59bd99 Add js func. 2014-02-13 15:20:10 -08:00
thintz
69a6f9c3ff Change compile to compile-site and add clean param. 2013-10-25 10:45:31 -07:00

View File

@@ -7,12 +7,12 @@
sxml->html sxml->html
; helper functions ; helper functions
markdown-file->sxml link link-list css markdown-file->sxml link link-list css js
; core functions ; core functions
add-page! delete-page! add-css! delete-css! add-page! delete-page! add-css! delete-css!
add-file-resource! delete-file-resource! add-file-resource! delete-file-resource!
compile compile-site
) )
(import chicken scheme files srfi-1 extras ports irregex) (import chicken scheme files srfi-1 extras ports irregex)
@@ -63,6 +63,9 @@
(define (css path) (define (css path)
`(link (@ (rel "stylesheet") (href ,(++ (link-root) path))))) `(link (@ (rel "stylesheet") (href ,(++ (link-root) path)))))
(define (js path)
`(script (@ (type "text/javascript") (src ,(++ (link-root) path)))))
(define (add-page! path body) (define (add-page! path body)
(hash-table-set! *pages* path body)) (hash-table-set! *pages* path body))
@@ -110,8 +113,8 @@
(file-copy (++ (res-dir) "/" p) path-out))) (file-copy (++ (res-dir) "/" p) path-out)))
*file-resources*)) *file-resources*))
(define (compile) (define (compile-site #!key (clean #t))
(and (directory? (out-dir)) (delete-directory (out-dir) #t)) (when clean (and (directory? (out-dir)) (delete-directory (out-dir) #t)))
(output-pages) (output-pages)
(output-stylesheets) (output-stylesheets)
(copy-file-resources)) (copy-file-resources))