diff --git a/templates/_blocks/index.twig b/templates/_blocks/index.twig index e69de29..1ae0127 100644 --- a/templates/_blocks/index.twig +++ b/templates/_blocks/index.twig @@ -0,0 +1,7 @@ +{% set blocks = blocks ?? [] %} + +{% for block in blocks %} + {{ include("_blocks/_#{block.type.handle}.twig", { + block, + }) }} +{% endfor %} diff --git a/templates/_elements/home.twig b/templates/_elements/home.twig index 070ed7f..e15d9f4 100644 --- a/templates/_elements/home.twig +++ b/templates/_elements/home.twig @@ -4,10 +4,4 @@ {{ include("_blocks/index.twig", { blocks: entry.pageBlocks, }) }} - - {% for block in entry.pageBlocks %} - {{ include("_blocks/_#{block.type.handle}.twig", { - block, - }) }} - {% endfor %} {% endblock %}