anatoo / metalsmith-partial

A metalsmith plugin for a partial
8 stars 2 forks source link

Add ability to pass data into a partial #1

Closed zenorocha closed 6 years ago

zenorocha commented 9 years ago

Partials would become super handy if they could pass data:

{{ partial('foobar.html', user) }}

That way a partial could render dynamic content from the main file:

<p>{{ user.name }}</p>

What do you think?

karneaud commented 8 years ago

Hmmm this is cool. Was wondering if this was done?

karneaud commented 8 years ago

How does this work with handlebars?

karneaud commented 8 years ago

I'm trying your code with the handlebar engine and get the following error

Metalsmith · Parse error on line 1: {{ partial('section-sta ---^ Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'