foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Custom data on partials #147

Open ejpg opened 6 years ago

ejpg commented 6 years ago

Im trying to create one partial into another, and i want to put panini's yml custom data in the head of the file.

Here's an example

partials/home_cards_es.html

---
btn: COMPRAR
---
{{> home_cards}}

partials/home_cards_en.html

---
btn: BUY
---
{{> home_cards}}

Is there a way to do this?

Thanksssss

kazagkazag commented 6 years ago

You can pass argument to custom partial:

page:

---
layout: transactional-email
subject: Transactional email prototype
linkTitle: CLICK ME PLEASE
---
{{#> link href="http://page.com" title=linkTitle }}
    My label
{{/link}}

and partial:

<a href="{{href}}" class="link" title="{{title}}">{{> @partial-block }}</a>