Skip to content

Deprecation: include tag

Taylor Hunt edited this page Aug 2, 2019 · 7 revisions

The <include> tag is deprecated in favor of either <${dynamic}/> tagnames or dynamic text ${placeholders}.

Rendering another template via its path

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

…now uses the import statement and a dynamic tagname:

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

<${Layout}>
  Hello World
</>

data/input to be used inside templates

<include('../../layouts/site-layout.marko', input)>
  Hello World
</include>
import Layout from "../../layouts/site-layout.marko"

<${Layout} ...input>
  Hello World
</>

Rendering a dynamic renderBody

<include(input.body)/>

This is now replaced completely by dynamic tagnames:

<${input.body}/>

Writing arbitrary strings

$ const text = "hi"

<p>
  <include(text)/>
</p>

This is now replaced entirely by dynamic text placeholders:

$ const text = "hi"

<p>
  ${text}
</p>