Strange Markdownify Error

Hey, I’m messing around with Hugo and I’m trying to get a short description of each blog post on the front page. (not an excerpt a custom written “marquee” that isn’t in the post)
I made a variable in the front of the post.

+++
marquee = "BLAH BLAH __BLAH__"
+++

In the template I refer to that variable

<div> {{ $page.Params.marquee | markdownify }} </div>

(pretty sure the page variable is correctly assigned in the template I’m using I didn’t write it)
{{ range $name, $page := .Site.Pages }}

The strange thing is it seems to work fine, but hugo throws an error on building.

Error while rendering "home": template: index.html:20:38: executing "index.html" at <markdownify>: wrong number of args for markdownify: want 1 got 0

I think it means that somewhere you call that, a marquee is value is empty (hence want 1 got 0). You can probably add an if or .IsHome, since you are probably not setting a marquee value for your home page.

Try:

{{ with $page.Params.marquee }}
<div> {{ . | markdownify }} </div>
{{ end }}
1 Like

Yep, it was iterating over the entire page list not just posts.
Thanks for the hep everyone.