# Pollen's define-meta isn't working, get-template-for ignores it

**URL:** <https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028>\
**Category:** Questions & Answers\
**Tags:** question, pollen\
**Created:** [June 20, 2023, 2:39am UTC](https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028 "2023-06-20T02:39:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurinoku](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kurinoku](https://racket.discourse.group/u/kurinoku)\
**Post date:** [June 20, 2023, 2:39am UTC](https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028/1 "2023-06-20T02:39:44Z")

</div>

I'm using pollen, I have this directory setup

```scheme
.
|- template.html.p
|- template.html
|- topic-welcome.html
|- topic-welcome.html.p
|- subdir
| |- index.poly.p

```

index.poly.p contents are

```scheme
#lang pollen

◊(define-meta template (list "topic-welcome.html" "topic-welcome.md"))

◊title{Hello, new topic}

```

in pollen.rkt i have

```scheme
(module setup racket/base
  (provide (all-defined-out))
  (define poly-targets '(md sexp html)))

```

and markdown is recognized as the main output format.

I ran this in a repl opened in drracket in the file pollen.rkt

```scheme
> (parameterize ([current-poly-target 'html])
    (displayln (get-template-for (simple-form-path "subdir/index.poly.pm")))
    (displayln (select-from-metas 'template (simple-form-path "subdir/index.poly.pm"))))
${FULL_PATH}/./template.html
(list topic-welcome.html topic-welcome.md)

```

I am bashing my head against the wall, pardon my way of expressing myself, but I'm very tired and frustrated to what seems to be the most straightforward use of `define-meta`, it is likely that I made a mistake, but I really can't show code because it's for work. I don't know what to do, any ideas?

---

<div class="post-metadata">

**Author:** ![kurinoku](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kurinoku](https://racket.discourse.group/u/kurinoku)\
**Post date:** [June 20, 2023, 3:12am UTC](https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028/2 "2023-06-20T03:12:35Z")

</div>

Two things, honestly the documentation, while clear, if read carelessly you can misunderstand that [get-template-for documentation](https://docs.racket-lang.org/pollen/Render.html#%28def._%28%28lib._pollen%2Frender..rkt%29._get-template-for%29%29) both the first and second method look upwards from the file directory. That was confusing but my fault.

The other is that the extension comparison in the branch for loading the template from metas uses `eq?` when you can use this `racket -e '(eq? "html" (substring "a.html" 2))'` to find that this won't work.  
So yeah, too many headaches.

Edit: it's the source file render.rkt at line 461, the eq? should be replaced with an equal?  
Edit 2: I might sound too angry, but I don't blame the author, I have committed the same error before, I'm just on the deadline.

---

<div class="post-metadata">

**Author:** ![joeld](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joeld/32/38_2.png) [@joeld](https://racket.discourse.group/u/joeld)\
**Post date:** [June 20, 2023, 9:48pm UTC](https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028/3 "2023-06-20T21:48:51Z")

</div>

> [@kurinoku](#):
>
> Edit: it's the source file render.rkt at line 461, the eq? should be replaced with an equal?

I think you’re right that line might be the problem, but the actual fix may be more involved, because one of the arguments to `eq?` there would sometime be a symbol.

I’ve posted [an issue](https://git.matthewbutterick.com/mbutterick/pollen/issues/271) on the git repo.

---

<div class="post-metadata">

**Author:** ![joeld](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/joeld/32/38_2.png) [@joeld](https://racket.discourse.group/u/joeld)\
**Post date:** [June 22, 2023, 1:59pm UTC](https://racket.discourse.group/t/pollens-define-meta-isnt-working-get-template-for-ignores-it/2028/4 "2023-06-22T13:59:19Z")

</div>

Update: The issue was closed with [this commit](https://git.matthewbutterick.com/mbutterick/pollen/commit/1d1cc0df84c3b906fc6108fab6ee27b8249580c5), try updating with `raco pkg update pollen` to confirm if this is fixed for you.
