diff options
Diffstat (limited to 'boudin.scm')
-rw-r--r-- | boudin.scm | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/boudin.scm b/boudin.scm index 4f6a1b3..b56b93b 100644 --- a/boudin.scm +++ b/boudin.scm | |||
@@ -1,7 +1,9 @@ | |||
1 | ;;; boudin | 1 | ;;; boudin |
2 | 2 | ||
3 | (import (boudin page) | 3 | (import (boudin page) |
4 | (boudin page instances) | 4 | (boudin page post) |
5 | (boudin page index) | ||
6 | (boudin page style) | ||
5 | (boudin page write) | 7 | (boudin page write) |
6 | (boudin site) | 8 | (boudin site) |
7 | (boudin util) | 9 | (boudin util) |
@@ -37,29 +39,46 @@ | |||
37 | (with-progress (string-append "Writing " (page-output pg)) | 39 | (with-progress (string-append "Writing " (page-output pg)) |
38 | (lambda () (write-page pg)))) | 40 | (lambda () (write-page pg)))) |
39 | (append posts | 41 | (append posts |
40 | (list (make-index posts) | 42 | (list (apply make-style (site-style)) |
43 | (make-index posts) | ||
41 | (make-feed posts))))) | 44 | (make-feed posts))))) |
42 | (eprint "Done!")) | 45 | (eprint "Done!")) |
43 | 46 | ||
44 | (define (main args) | 47 | (define (main args) |
45 | (define *current #f) | 48 | (define *current #f) |
49 | (define glob? #t) | ||
50 | (when (null? args) | ||
51 | (exit 1)) | ||
46 | (let loop ((args args)) | 52 | (let loop ((args args)) |
47 | (cond | 53 | (cond |
48 | ((null? args) (go!)) | 54 | ((null? args) |
55 | (for-each print (site-posts)) | ||
56 | (go!)) | ||
57 | ;; Configuration file: -c FILE | ||
49 | ((equal? (car args) "-c") | 58 | ((equal? (car args) "-c") |
50 | (site-config (cadr args)) | 59 | (site-config (cadr args)) |
51 | (loop (cddr args))) | 60 | (loop (cddr args))) |
52 | ((not *current) ; add to posts by default | 61 | ;; Change directory: -C DIRECTORY |
53 | (site-posts (cons (car args) (site-posts))) | 62 | ((equal? (car args) "-C") |
63 | (change-directory (cadr args)) | ||
64 | (loop (cddr args))) | ||
65 | ;; Don't glob filenames: -r (raw) | ||
66 | ((equal? (car args) "-r") | ||
67 | (set! glob? #f) | ||
54 | (loop (cdr args))) | 68 | (loop (cdr args))) |
69 | ;; Posts follow -p | ||
55 | ((equal? (car args) "-p") | 70 | ((equal? (car args) "-p") |
56 | (set! *current site-posts) | 71 | (set! *current site-posts) |
57 | (loop (cdr args))) | 72 | (loop (cdr args))) |
73 | ;; Files follow -f | ||
58 | ((equal? (car args) "-f") | 74 | ((equal? (car args) "-f") |
59 | (set! *current site-files) | 75 | (set! *current site-files) |
60 | (loop (cdr args))) | 76 | (loop (cdr args))) |
77 | ;; Append current path to *current | ||
61 | (else | 78 | (else |
62 | (*current (cons (car args) (*current))) | 79 | (let ((*current (or *current site-posts))) ; posts by default |
80 | (*current (append ((if glob? glob list) (car args)) | ||
81 | (*current)))) | ||
63 | (loop (cdr args)))))) | 82 | (loop (cdr args)))))) |
64 | 83 | ||
65 | (cond-expand | 84 | (cond-expand |