Open casouri opened 3 years ago
Pollen’s template rendering is derived from the include-template
function in Racket, which itself demands files as input. In other words, this limitation is outside Pollen, and thus “hacking Pollen” won’t change it.
Can I use the template file as input, and rebind doc
to my generated stuff?
No, but you can put your doc in a temp file and render that.
On Jul 3, 2021, at 8:40 AM, Yuan Fu @.***> wrote:
Can I use the template file as input, and rebind doc to my generated stuff?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I see, that's probably the easiest way. Thanks.
(Shameless plug) My Beeswax library should help you accomplish this without relying on a temp file. (Caveat emptor, still under development on a very spare-time basis!)
Perhaps also look into Colophon by @basus.
FWIW I’m not a blogger. I’ve never used Pollen to make blogs. Thus I have never made bloggy features a priority. Especially because there are already a zillion blog engines to choose from. So if someone is choosing to make a blog with Pollen, I conclude that they must have their reasons for doing things the hard way. I salute their struggle, because it results in wisdom.
(Shameless plug) My Beeswax library should help you accomplish this without relying on a temp file. (Caveat emptor, still under development on a very spare-time basis!)
This is exactly what I asked for! Thanks.
Although blog engines come with facilities pre-built, those facilities impose some limitations and force one to do things their way. With Pollen I have to implement most of the things myself, but I also get the freedom to do everything in my way.
My blog has category indexes for my posts, such as indexes for "Emacs", "Tech", "Web", etc. These index pages repeat and their contents are automatically generated, so it doesn't make much sense to create individual, mostly identical files for each.
Since the contents are programmatically generated, I can easily create a
doc
, but AFAIK there isn't a pubilc API that renders it with a template. The closest I can find isrender-to-file
, but it only takes a source path. Is there any way to do what I want without hacking Pollen? If there isn't, where should I look start? Thanks.