-
I want to use Mailchimp's HandlebarJS support and use Maizzle to pregenerate my HTML templates for it.
During development my
I would expect to be able to use in my
So my code would expand to literally to:
It's quite difficult to generate templates with Maizzle that also contains handlebar syntax.
But that doesn't help. Thanks for any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
It would be great to have some directive that would tell Maizzle to treat HandlebarJS expressions literally.
This is not feasible when trying to replace HTML attributes. Perhaps there's some trick I don't know about. |
Beta Was this translation helpful? Give feedback.
-
The way config files work in Maizzle is that a production config will be merged on top of the dev one, so you don't need to specify values that won't change (see docs). Can you show me exactly how you'd wish to write it in Maizzle and what it would output when compiled? |
Beta Was this translation helpful? Give feedback.
-
Got it, thanks for the detailed explanation. This works fine in the latest version (4.2.2): // config.js
module.exports = {
url: 'https://example.com',
} // config..production.js
module.exports = {
url: '{{ variable }}',
} <!-- src/templates/example.html -->
<div data-url="{{ page.url }}">
{{ page.url }}
</div> ResultsLocal development with <div data-url="https://example.com">
https://example.com
</div> Building for production with <div data-url="{{ variable }}">
{{ variable }}
</div> |
Beta Was this translation helpful? Give feedback.
-
Please provide a repo that reproduces the issue, I'm unable to reproduce this on my end. |
Beta Was this translation helpful? Give feedback.
-
Also, remember that if you use the variable inside a https://maizzle.com/docs/transformers/remove-unused-css#backend And there's also the way we treat special characters in class names: https://maizzle.com/docs/transformers/safe-class-names For this one I suggest defining it in your production config so it doesn't remove module.exports = {
safeClassNames: {
'{': '{',
'}': '}',
},
} But again, this |
Beta Was this translation helpful? Give feedback.
-
I am having a problem that seems related to this somehow - for Braze liquid - in one banner I needed to leave a shortcode for the text color so it could be assigned from content taken from contentful. In the braze config I specified Maizzle 3 was fine with it - but v4 is not liking it. reason: 'Unknown word', It gets compiled into the style with the other properties from Tailwind but gives this error - I am going to work on it some more - try try and get clear what is happening. |
Beta Was this translation helpful? Give feedback.
Please provide a repo that reproduces the issue, I'm unable to reproduce this on my end.