Skip to content

Instantly share code, notes, and snippets.

@cossssmin
Created August 18, 2020 16:48
Show Gist options
  • Save cossssmin/6d48351db0f135ad8783efffaa9f6f0b to your computer and use it in GitHub Desktop.
Save cossssmin/6d48351db0f135ad8783efffaa9f6f0b to your computer and use it in GitHub Desktop.
Nesting components in Maizzle
<!-- src/layouts/master.html -->
<!DOCTYPE {{{ page.doctype || 'html' }}}>
<html lang="{{ page.language || 'en' }}">
<head>
<meta charset="{{ page.charset || 'utf-8' }}">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="x-apple-disable-message-reformatting">
<!--[if mso]>
<xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml>
<![endif]-->
</head>
<body>
<block name="template"></block>
</body>
</html>
<!-- template.html -->
<extends src="src/layouts/master.html">
<block name="template">
<component src="src/components/component-1.html">
Parent
</component>
</block>
</extends>
<!-- src/components/component-1.html -->
<component src="component-2.html">
Component 1
</component>
Content from parent:
<content></content>
<!-- src/components/component-2.html -->
Component 2
Content from Component 1:
<content></content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment