gulp-assemble icon indicating copy to clipboard operation
gulp-assemble copied to clipboard

Data in layouts

Open Zackio opened this issue 9 years ago • 0 comments

Hi, I'm trying to get variables to pick up in layouts. Is it not possible to set variables in layouts at the moment, or am I doing it wrong? Thanks

With the grunt assemble I was able to add front matter to a layout like this:

layout/index.hbs:


---
layout: default
test: blabla

---

title: {{test}}  // Doesn't show anything
title: {{index.test}} // Doesn't show anything

{{debug}} // Variable not there

{% body %}

The var would be passed on to the default template.

With the new assemble, the layout declaration is picked up, but I'm not able to set variables. I tried this too:

assemble.layout('index', { content: '{{title}} {% body %}', layout: 'default', data: { "title": "Top Dark Menu" } } );

Zackio avatar Apr 07 '15 06:04 Zackio