diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index 68c083b..b40a46e 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1518765983 +1518792093 diff --git a/pollen/render.rkt b/pollen/render.rkt index d184d2a..4ce086e 100644 --- a/pollen/render.rkt +++ b/pollen/render.rkt @@ -235,15 +235,15 @@ pollen/pagetree pollen/core) DIRECTORY-REQUIRE-FILES - (parameterize ([current-pagetree (make-project-pagetree CPR)]) - (define DOC-ID (cached-doc SOURCE-PATH-STRING)) - (define META-ID (cached-metas SOURCE-PATH-STRING)) + (parameterize ([current-pagetree (make-project-pagetree CPR)] + [current-metas (cached-metas SOURCE-PATH-STRING)]) (local-require pollen/template pollen/top) + (define DOC-ID (cached-doc SOURCE-PATH-STRING)) + (define META-ID (current-metas)) (define here (path->pagenode (or (select-from-metas 'HERE-PATH-KEY META-ID) 'unknown))) - (parameterize ([current-metas META-ID]) - (if (bytes? DOC-ID) ; if main export is binary, just pass it through - DOC-ID - (include-template #:command-char COMMAND-CHAR (file TEMPLATE-PATH))))))))) + (if (bytes? DOC-ID) ; if main export is binary, just pass it through + DOC-ID + (include-template #:command-char COMMAND-CHAR (file TEMPLATE-PATH)))))))) ;; set current-directory because include-template wants to work relative to source location (time (parameterize ([current-directory (->complete-path (dirname source-path))]) (render-through-eval expr-to-eval)))) diff --git a/pollen/scribblings/core.scrbl b/pollen/scribblings/core.scrbl index 402c8c0..38d9cac 100644 --- a/pollen/scribblings/core.scrbl +++ b/pollen/scribblings/core.scrbl @@ -148,9 +148,10 @@ Note that if @racket[_meta-source] is a relative path or pagenode, it is treated @section[#:tag "core"]{Parameters} -@defparam[current-metas hash (or/c #f hash?) #:value #f]{Holds the @racket[metas] of the current Pollen source. In tag functions, rather than pass @racket[metas] as an argument, you can refer to @racket[(current-metas)] within the body of the function. Likewise, if your tag function calls other tag functions, they can all invoke @racket[(current-metas)] instead of passing the value around. +@defparam[current-metas hash (or/c #f hash?) #:value #f] +Holds the @racket[metas] of the current Pollen source. In tag functions, rather than pass @racket[metas] as an argument, you can refer to @racket[(current-metas)] within the body of the function. Likewise, if your tag function calls other tag functions, they can all invoke @racket[(current-metas)] instead of passing the value around. @racket[(current-metas)] will also work in templates, holding the @racket[metas] of the source currently being rendered into the template. -Note that the default value is @racket[#f]. This indicates that no metas value is available. It is up to you to code your tag functions to do something sensible if this circumstance arises.} +Note that the default value is @racket[#f]. This indicates that no metas value is available. It is up to you to code your tag functions to do something sensible if this circumstance arises.