|
|
|
@ -455,11 +455,12 @@
|
|
|
|
|
(with-handlers ([exn:fail:contract? (λ (e) #f)]) ; in case source-path doesn't work with cached-require
|
|
|
|
|
(parameterize ([current-directory (current-project-root)])
|
|
|
|
|
(define source-metas (cached-metas source-path))
|
|
|
|
|
(define template-name-or-names ; #f or atom or list
|
|
|
|
|
(select-from-metas pollen-template-meta-key source-metas))
|
|
|
|
|
(define template-name (if (list? template-name-or-names)
|
|
|
|
|
(findf (λ (tn) (eq? (get-ext tn) output-path-ext)) template-name-or-names)
|
|
|
|
|
template-name-or-names))
|
|
|
|
|
(define template-name (match (select-from-metas pollen-template-meta-key source-metas) ; #f or atom or list
|
|
|
|
|
[(? list? names)
|
|
|
|
|
(for/first ([name (in-list names)]
|
|
|
|
|
#:when (equal? (get-ext name) (->string output-path-ext)))
|
|
|
|
|
name)]
|
|
|
|
|
[other other]))
|
|
|
|
|
(and template-name (simplify-path (cleanse-path (build-path (dirname source-path) template-name)))))))
|
|
|
|
|
|
|
|
|
|
(define (get-default-template source-path output-path-ext)
|
|
|
|
|