From bb4091acb58f0724dca262bc137715f6ed882e5f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 8 Sep 2023 08:55:10 -0500 Subject: 1.0, why not --- boudin.scm | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'boudin.scm') diff --git a/boudin.scm b/boudin.scm index 4f6a1b3..b56b93b 100644 --- a/boudin.scm +++ b/boudin.scm @@ -1,7 +1,9 @@ ;;; boudin (import (boudin page) - (boudin page instances) + (boudin page post) + (boudin page index) + (boudin page style) (boudin page write) (boudin site) (boudin util) @@ -37,29 +39,46 @@ (with-progress (string-append "Writing " (page-output pg)) (lambda () (write-page pg)))) (append posts - (list (make-index posts) + (list (apply make-style (site-style)) + (make-index posts) (make-feed posts))))) (eprint "Done!")) (define (main args) (define *current #f) + (define glob? #t) + (when (null? args) + (exit 1)) (let loop ((args args)) (cond - ((null? args) (go!)) + ((null? args) + (for-each print (site-posts)) + (go!)) + ;; Configuration file: -c FILE ((equal? (car args) "-c") (site-config (cadr args)) (loop (cddr args))) - ((not *current) ; add to posts by default - (site-posts (cons (car args) (site-posts))) + ;; Change directory: -C DIRECTORY + ((equal? (car args) "-C") + (change-directory (cadr args)) + (loop (cddr args))) + ;; Don't glob filenames: -r (raw) + ((equal? (car args) "-r") + (set! glob? #f) (loop (cdr args))) + ;; Posts follow -p ((equal? (car args) "-p") (set! *current site-posts) (loop (cdr args))) + ;; Files follow -f ((equal? (car args) "-f") (set! *current site-files) (loop (cdr args))) + ;; Append current path to *current (else - (*current (cons (car args) (*current))) + (let ((*current (or *current site-posts))) ; posts by default + (*current (append ((if glob? glob list) (car args)) + (*current)))) (loop (cdr args)))))) (cond-expand -- cgit 1.4.1-21-gabe81