Layouts configuration

Configure where your Layouts are located, and how you reference them.

root

You may define the path where your Layouts are located:

config.js
module.exports = {
  build: {
    layouts: {
      root: './src/layouts'
    }
  }
}

You will then be able to extend Layouts by referencing them relative to that path - no need to write out the full path relative to your project root:

src/templates/example.html
<extends src="main.html">
  <block name="template">
    <!-- ... -->
  </block>
</extends>

tagName

You may also customize the <extends> tag name:

config.js
module.exports = {
  build: {
    layouts: {
      tagName: 'layout'
    }
  }
}

Usage:

src/templates/example.html
<layout src="src/layouts/main.html">
  <block name="template">
    <!-- ... -->
  </block>
</layout>
Copyright © 2023 Maizzle SRL Brand policy
Edit this page on GitHub