Index: dust.rkt ================================================================== --- dust.rkt +++ dust.rkt @@ -21,10 +21,11 @@ ;; https://joeldueck.com ;; ------------------------------------------------------------------------- (require pollen/core pollen/pagetree + pollen/setup net/uri-codec gregor txexpr racket/list racket/string) @@ -65,11 +66,11 @@ ;; or '|| if no series is specified. (define (series-pagenode) (define maybe-series (or (select-from-metas 'series (current-metas)) "")) (cond [(non-empty-string? maybe-series) - (->pagenode (string-append series-path "/" maybe-series ".html"))] + (->pagenode (format "~a/~a.html" series-path maybe-series))] [else '||])) (define (series-noun) (define series-pnode (series-pagenode)) (case series-pnode @@ -87,18 +88,18 @@ (define (include-in-pagetree folder extension) (define (matching-file? f) (string-suffix? f extension)) (define (file->output-pagenode f) (string->symbol (format "~a/~a" folder (string-replace f extension ".html")))) - - (define file-strs (map path->string (directory-list folder))) + (define folder-path (build-path (current-project-root) folder)) + (define file-strs (map path->string (directory-list folder-path))) (map file->output-pagenode (filter matching-file? file-strs))) -(define articles-pagetree +(define (articles-pagetree) `(root ,@(include-in-pagetree articles-path ".poly.pm"))) -(define series-pagetree +(define (series-pagetree) `(root ,@(include-in-pagetree series-path ".poly.pm"))) ;; ~~~ Convenience functions for tagged x-expressions ~~~ (define (attr-present? name attrs)