let `get-doc` and `get-metas` work with pagetree sources (fixes #159)

pull/160/merge
Matthew Butterick 7 years ago
parent 6c14fde7bc
commit a731428072

@ -85,15 +85,12 @@
(define (convert+validate-path pagenode-or-path caller) (define (convert+validate-path pagenode-or-path caller)
(let ([path (get-source (if (pagenode? pagenode-or-path) (let* ([path (if (pagenode? pagenode-or-path)
(build-path (current-project-root) (symbol->string pagenode-or-path)) (build-path (current-project-root) (symbol->string pagenode-or-path))
pagenode-or-path))]) pagenode-or-path)]
(unless path [path (or (get-source path) path)])
;; use `pagenode-or-path` in error message because at this point `path` is #f (unless (file-exists? path)
(raise (raise-argument-error caller "existing Pollen source, or name of its output path" path))
(make-exn:fail:filesystem
(format "~a: no source found for '~a' in directory ~a" caller pagenode-or-path (current-directory))
(current-continuation-marks))))
path)) path))

@ -1 +1 @@
1513026723 1513200079

Loading…
Cancel
Save