maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.24k stars 49 forks source link

Default layout not loaded #73

Closed lowv-developer closed 4 years ago

lowv-developer commented 4 years ago

Description:

If the layout var is not declared inside template, the default layout is not exported.

Steps To Reproduce:

Default installation

Solution:

$ @maizzle/framework/src/generators/output/toString.js

//html = hasLayout ? `{% extends "${hasLayout}" %}\n${html}` : html
html = layoutPath ? `{% extends "${layoutPath}" %}\n${html}` : html
cossssmin commented 4 years ago

The code you mentioned has been added in v0.5.0 for template inheritance to work properly. I'm investigating, but I think I'm going to roll back the template inheritance feature until we get it right.

cossssmin commented 4 years ago

Rolled it back for now, releasing a hotfix...

lowv-developer commented 4 years ago

I've made the tests, the const hasLayout seems to me unnecessary in general. i think that you use it only in this place.

cossssmin commented 4 years ago

It was so that you could extend a template from another template - see #69

Obviously it didn't work as expected, resulting in no layout when serveing and the same layout for all templates otherwise (even if you had specified a custom layout in Front Matter).

Released v.0.5.1 as a hotfix 👍