-
Notifications
You must be signed in to change notification settings - Fork 649
Deprecation: include tag
Dave Honneffer edited this page Jan 11, 2019
·
7 revisions
The <include>
tag has been deprecated in favor of using either the <${dynamic}/>
tag or a ${placeholder}
.
Here are some examples of how you can migrate your existing code:
Old:
<include('../../layouts/site-layout.marko')>
Hello World
</include>
New:
import Layout from "../../layouts/site-layout.marko"
<${Layout}>
Hello World
</>
<include('../../layouts/site-layout.marko', data)>
Hello World
</include>
New:
import Layout from "../../layouts/site-layout.marko"
<${Layout} ...data>
Hello World
</>
Old:
<include(input.body)/>
New:
<${input.body}/>
Old:
$ const text = "hi"
<div>
<include(text)/>
</div>
New:
$ const text = "hi"
<div>
${text}
</div>
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.