diff --git a/docs/src/main/asciidoc/qute-reference.adoc b/docs/src/main/asciidoc/qute-reference.adoc index ec15b22043500..3d6ff364bdba4 100644 --- a/docs/src/main/asciidoc/qute-reference.adoc +++ b/docs/src/main/asciidoc/qute-reference.adoc @@ -831,27 +831,26 @@ Template inheritance makes it possible to reuse template layouts. {#insert title}Default Title{/} <1> - {#insert body}No body!{/} <2> + {#insert}No body!{/} <2> ---- <1> `insert` sections are used to specify parts that could be overridden by a template that includes the given template. -<2> An `insert` section may define the default content that is rendered if not overridden. +<2> An `insert` section may define the default content that is rendered if not overridden. If no name parameter is supplied then the main block of the relevant `{#include}` section is used. .Template "detail" [source,html] ---- {#include base} <1> {#title}My Title{/title} <2> - {#body} -
- My body. -
- {/body} +
<3> + My body. +
{/include} ---- <1> `include` section is used to specify the extended template. <2> Nested blocks are used to specify the parts that should be overridden. +<3> The content of the main block is used for an `{#insert}` section with no name parameter specified. NOTE: Section blocks can also define an optional end tag - `{/title}`. diff --git a/independent-projects/qute/core/src/main/java/io/quarkus/qute/IncludeSectionHelper.java b/independent-projects/qute/core/src/main/java/io/quarkus/qute/IncludeSectionHelper.java index ed8e2c100d13f..b3a0b59497313 100644 --- a/independent-projects/qute/core/src/main/java/io/quarkus/qute/IncludeSectionHelper.java +++ b/independent-projects/qute/core/src/main/java/io/quarkus/qute/IncludeSectionHelper.java @@ -13,6 +13,7 @@ public class IncludeSectionHelper implements SectionHelper { + static final String DEFAULT_NAME = "$default$"; private static final String TEMPLATE = "template"; private final Supplier