Skip to content

Upgrade to v2

Matt Mc edited this page Jul 13, 2018 · 3 revisions

Upgrade to v2

Because the {{block}} syntax changed slightly and the old syntax isn't backwards-compatible you need to update all of your block and yield definitions. It's a purely mechanical update in nature – you can find a regular expression to search for the old syntax below.

Old {{block}} syntax:

{{block menu}}
{{end}}

New {{block}} syntax:

{{block menu()}}
{{end}}

Old {{yield}} syntax:

{{yield menu}}

New {{yield}} syntax:

{{yield menu()}}

Here's the regular expression to find all the old block and yield definitions: {{\s*(block|yield)\s+\w+\s*}}.

We did this to introduce new features:

  • Local variables with defaults, here.
  • Wrapping of defined blocks at the time of invocation, here.
Clone this wiki locally