diff --git a/examples/warp03/templates/intermediate.rs.html b/examples/warp03/templates/intermediate.rs.html index 653f79e..be3fa56 100644 --- a/examples/warp03/templates/intermediate.rs.html +++ b/examples/warp03/templates/intermediate.rs.html @@ -1,7 +1,7 @@ @use super::base_html; @(title: &str, htmlargs: Content, content: Content) -@:base_html(title, htmlargs, { +@:base_html(title, {@:htmlargs()}, { @:content()
This whole site is an example.
}) diff --git a/src/Template_syntax.rs b/src/Template_syntax.rs index 90fdf70..7fe77ef 100644 --- a/src/Template_syntax.rs +++ b/src/Template_syntax.rs @@ -301,4 +301,26 @@ pub mod d_Calling_other_templates { //!page content ...
//! }) //! ``` + //! + //! ## Intermediate templates with block parameters + //! + //! Due to a limitation in Ructe, it is currently not possible to + //! take a block parameter and send directly along to further + //! templates. + //! The following will not work: + //! + //! ```compile_fail + //! @(title: &str, body: Content) {{ + //! @:base_page_html(title, body) + //! }} + //! ``` + //! + //! Instead, the parameter needs to be a block, even if only to + //! call the existing one: + //! + //! ```text + //! @(title: &str, body: Content) {{ + //! @:base_page_html(title, {@:body()}) + //! }} + //! ``` }