This sounds wrong. 

And yet: is it? 

`current-project-root` is documented as the "the directory where you launched 
raco pollen start". (I'm not saying that pedantically — I often read the Pollen 
docs to find out things I've forgotten ;) 

The idea of `raco pollen render --recursive` is that every directory is being 
treated as its own subproject. Same as if you had done `cd` into each directory 
and `raco pollen render` from there. Indeed, during a `raco pollen render` 
operation, there's no way to infer what the "real" home directory is. Except 
that Pollen will search upward, to the top of your filesystem if necessary, for 
a "pollen.rkt".

So I come around to thinking your solution — create your own value and export 
it — is the right one.

Or, you could create a pagetree in the home directory — maybe it 
programmatically picks up the pages in the subdirectories — and render that. 
Then you can avoid `raco pollen render --recursive`, and rather just `raco 
pollen render` from the base directory, and `current-project-root` will 
(should!) stay consistent.

> On Mar 7, 2018, at 3:32 AM, 'Leandro Facchinetti' via Pollen 
> <> wrote:
> Consider the following Pollen project:
>  ;; a.txt.pp
>  #lang pollen
>  ◊(current-project-root)
>  ;; s/b.txt.pp
>  #lang pollen
>  ◊(current-project-root)
> I wish the outputs of ‘current-project-root’ to be consistent, always 
> pointing to the project root where a ‘pollen.rkt’ might live. When I ‘raco 
> pollen start’, the development server exhibits that behavior: I visit both 
> ‘http://<localhost>/a.txt’ and ‘http://<localhost>/s/b.txt’ and see the same 
> output. But when I ‘raco pollen render --recursive’, the outputs disagree: 
> ‘s/b.txt’ includes the ‘s/’ directory.
> My current workaround is to use ‘define-runtime-path’ in ‘pollen.rkt’ and 
> forego ‘current-project-root’. Is there a better solution?

You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to