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.

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

Should become:

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

<${Layout}>
  Hello World
</>

When using include to render a dynamic renderBody.

<include(input.body)/>

Should become:

<${input.body}/>

When using include to write an arbitrary string.

$ const text = "hi"

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

Should become:

$ const text = "hi"

<div>
  ${text}
</div>