mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
53 stars 0 forks source link

define-meta template issue? #97

Open matms opened 3 years ago

matms commented 3 years ago

I can't seem to figure out how to use ◊(define-meta template "...") correctly.

Whatever I do, it seems to default to using "template.<extension>.p", even if I try to use a different template file.

I tried to print ◊(get-template-for ◊mp-get-meta['here-path]) (where mp-get-meta is a custom function that accesses the metas) and it always prints the same file, irrespective of the template meta, even if ◊(mp-get-meta 'template) reports a different file.

Specifically, I would like to have the templates in a separate templates/ folder, and possibly allow choosing between different templates for different types of pages.

mbutterick commented 3 years ago

More information is needed to pinpoint the problem. For instance, suppose I create index.html.pm like so:

#lang pollen
◊(define-meta template "foobar.html")

hello world

And foobar.html like so:

I am FOOBAR

If I open index.html.pm in DrRacket and do this at the REPL:

(get-template-for (path->complete-path "index.html.pm"))

The result is:

#<path:/to/foobar.html>

Which is what I expect. If I go to the command line and do raco pollen render index.html, the resulting file index.html contains:

I am FOOBAR

Which is also correct.

matms commented 3 years ago

I just realized that my DrRacket can't even run my 'pollen.rkt' file (but compilation of documents still appears to work "correctly"... weird).

I will try to fix that first. If I do and this issue persists, I'll re-comment here.