You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can confirm, it won't work if you pass the object inline. Looks like this is actually how posthtml-expressions currently works, I've opened a PR to replicate the issue and see what could be done about it: posthtml/posthtml-expressions#146
In Maizzle you can either set that data in the config.js or in the template's Front Matter, and use it off the page object.
Here's how you'd do it with FM:
---
obj:
annual_revenue: 3000
employees: 3
---
<eachloop='key, value in page.obj'>
{{ key }}: {{ value }}
</each>
You'd use page.obj the same way if you added the data to config.js:
Thank you for your reply, currently, I adjust this in the created .hbs.
So every time I adjust the template, in maizzle I need to adjust it. For now, it's okay.
Im trying to loop over on object like
{annual_revenue: 3000, employees: 3}
, but when i doThe generated HTML is empty, when I loop over an array it is working.
But is it also possible to loop over a parameter coming from context, for example, with handlebars .hbs?
The text was updated successfully, but these errors were encountered: