Static Site Generator

How-to: How to add a new block?

How to add a new block?

Step 1

Open the HTML layout configuration file:

themes
+--- {theme}
     +--- layout
          +--- html.json

Add a new entry with the block template path:

{
    ...
    "banner": "template/block/banner.html"
    ...
}

Step 2

Create the new block template file with the HTML content:

themes
+--- {theme}
     +--- template
          +--- block
               +--- banner.html
<div id="banner>
    Welcome!
</div>

Step 3

Add the new block in the page template:

themes
+--- {theme}
     +--- template
          +--- default.html
<!-- ... -->
<main>
    {% banner %}
    <!-- ... -->
</main>
<!-- ... -->

Next