Skip to content

Commit

Permalink
Merge branch '23-feature-component-like-partial-templa'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antaris committed Nov 11, 2024
2 parents 59e5128 + 5129824 commit 3be12d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ Alternatively, you can use the HandlebarsJS syntax:

Handlebars.RegisterPartial("heading", "<h1>Hello {{>@partial-block}}</h1>");

To call this component, you can now specify the content to be inserted into the partial template:
To call this component, you can now specify the content to be inserted into the partial template. Not the block syntax `{{#>` instead of `{{>`

{{>heading}}World{{/heading}}
{{#>heading}}World{{/heading}}

Which should render:

Expand All @@ -340,6 +340,10 @@ Which you can call as:
{{>footer}}Footer{{/footer}}
{{/layout}}}

You can still pass arguments and maps to the partial template, but any expressions you use in your zones will be evaluated in the context of the outer template.

{{#>heading}}{{forename}} {{surname}}{{/heading}}

Text Encoding
-
Like HandlebarsJS, FuManchu encodes values by default, therefore all calls, such as `{{forename}}` etc, will be encoded. If you need to render the raw value, you can use the triple-brace syntax:
Expand Down

0 comments on commit 3be12d6

Please sign in to comment.