Skip to content

Data in layouts #27

@Zackio

Description

@Zackio

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" } } );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions