I don't have answers to your direct questions, but I can tell you that I
encountered some similar issues and decided to just roll my own solutions
for publishing.

Here I list all pollen files in my project for rendering:

https://gitlab.com/JoelMcCracken/joelmccracken.com/blob/88971b0c0a4f6fdc405c7f9a55bef4afc3875354/src/util.rkt#L27

Here is my build file that builds everything:
https://gitlab.com/JoelMcCracken/joelmccracken.com/blob/88971b0c0a4f6fdc405c7f9a55bef4afc3875354/src/build.rkt#L88

I handle static JS files by just copying them manually to the build
destination in a makefile:
https://gitlab.com/JoelMcCracken/joelmccracken.com/blob/88971b0c0a4f6fdc405c7f9a55bef4afc3875354/src/Makefile

On Tue, Jul 16, 2019 at 4:00 PM Shrutarshi Basu <s...@basus.me> wrote:

> After digging into the source code, I’m realizing that my suggestions
> won’t work as I put them, mainly due to the presence of pagetrees. which
> can control which files get rendered. I’m wondering if for my needs it
> might be easier to build a simpler custom front-end rather than trying to
> change how Pollen behaves.
>
> Also, can someone point me to where the functions `preproc-source?` and
> `pagetree-source?` live? I can’t seem to find them by grepping the pollen
> source code.
>
> Thanks,
> Basu
>
>
> On July 11, 2019 at 2:22:17 PM, Shrutarshi Basu (s...@basus.me) wrote:
>
>
> Hello everyone,
> I’m a little confused about the use of `omitted-path?`, and how paths are
> handled in general.
>
> Here is the setup: I have a project with a bunch of subdirectories. Some
> of those subdirectories have JavaScript, or images, etc. These directories
> *do not* need to be processed by `pollen render -s`, but *do* need to be
> processed by `pollen publish`. As a start, I tried to override
> `setup:omitted-path?` as directed in the documentation, and printed out the
> paths that were being handled by the function. I noticed some behavior that
> seems odd to me.
>
> First, during `pollen render -s`, the paths getting sent to
> `omitted-path?` seem to be paths of the subdirectories, not the files that
> are being rendered. This seems a little odd to me: what if I want some
> files in a directory to be rendered, and not others? But this is fine for
> omitting image or script directories for my use case.
>
> Second, during `pollen publish`, the paths sent to `omitted-path?` are (1)
> the paths in the `publish-directory` that the files will get copied to, not
> in the source directory, and (2) this time, the entire paths to the target
> files, not just the directories. (1) makes it harder to implement the
> functionality I want above, because I now I need to think in terms of the
> target directory, not the current project directory, and (2) seems
> inconsistent with what happens for `pollen render`, so `omitted-path?` will
> have to handle both cases.
>
> I’m not familiar with the internals of pollen, so maybe there is a good
> reason for `omitted-path?` to be used this way. But here are some
> suggestions for making things more uniform?
>
> 1. `omitted-path?` is always given the full source path for each *file*
> being considered.
> 2. `omitted-path?` is called for *every* file that is being considered for
> rendering, unless...
> 3. There is a `omitted-directory?` function that is called when pollen is
> about to descend into a directory. If it returns true, the entire directory
> is skipped, and the files and subdirectories in it do not need to be
> processed by `omitted-path?`.
> 4. There is an optional argument to `omitted-path?` that describes whether
> it is being called as part of a render or publish operation. This lets
> things like image directories be skipped during render, but included during
> publishing. Alternatively, render and publish could call separate functions
> to check for omission (that might be cleaner actually).
>
> I’m interested in helping develop pollen, so I’m happy to try and make
> these changes in a fork and send a pull request.
>
> I know there’s a note in the docs saying that `publish` might need
> improvement, so maybe my thoughts above relate to that?
>
> For reference, my `omitted-path?` implementation is below. Do let me know
> if I’m doing something wrong, or am just being ignorant.
>
> Thanks,
> Basu
>
>
> ;; Override Pollen parameters
> (module setup racket/base
>   (require racket/path pollen/setup)
>   (provide (all-defined-out))
>
>   (define publish-directory (expand-user-path "~/output/"))
>   (define img-path (path->complete-path "images/"))
>   (define js-path (path->complete-path "js/"))
>
>   (define (omitted-path? path)
>     (printf "Checking path: ~a\n" path)
>     (define p-only (path-only (path->complete-path path)))
>     (or (default-omitted-path? path)
>         (equal? p-only img-path)
>         (equal? p-only js-path)))
>  )
>
>
> --
> 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 to pollenpub+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pollenpub/CA%2BYT8Wgd4Z3XP974Hx7_YrT9mXRVL4LTmWErmVtcgj2zReG9JQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pollenpub/CA%2BYT8Wgd4Z3XP974Hx7_YrT9mXRVL4LTmWErmVtcgj2zReG9JQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 
to pollenpub+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pollenpub/CAOdqJSgx3WEkxh_SxNs0i60s-p0nJrHx1tMJxr%2BiG9NbqdTOuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to