define-meta template issue? #97

Open
opened 4 years ago by matms · 2 comments
matms commented 4 years ago (Migrated from github.com)

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.

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 4 years ago (Migrated from github.com)

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.

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 4 years ago (Migrated from github.com)

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.

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.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen-users#97
Loading…
There is no content yet.