Skip to content

Deprecation: include tag

Dylan Piercey edited this page Dec 26, 2018 · 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:

When using include to render another template via providing a string path.

Old:

<include('../../layouts/site-layout.marko')>
    Hello World
</layout-use>

New:

import Layout from "../../layouts/site-layout.marko"

<${Layout}>
  Hello World
</>

When using include to render a dynamic renderBody.

Old:

<include(input.body)/>

New:

<${input.body}/>

When using include to write an arbitrary string.

Old:

$ const text = "hi"

<div>
  <include(text)/>
</div>

New:

$ const text = "hi"

<div>
  ${text}
</div>