Closed leocreatini closed 8 years ago
@leocreatini Did you find a solution? The front-matter module doesn't automatically handle layouts. Looks like you might be using handlebars-layouts. If so, you could do this:
---
layout: name/of/layout
---
{{#extend file.frontMatter.layout}}
...
{{/extend}}
But I generally prefer to skip using frontMatter for that and just use the layout name directly.
Thanks for the reply. Sort of found a solution, I am in the process of hacking together a gulp assemble into its own plugin. The hb package has been wonderful for the page, yet piping the layout afterwards via assemble's manner with the {{> body }}
syntax was a hassle.
Ended up using front-matter, finding the page's layout, doing regex to replace the {{> body }}
with the content.body
, compiling the layout, then buffering it back out.
It was an eventful weekend :)
Hi Shannon, I know this is a bit of a tangent from gulp-hb, however, I've been struggling with incorporating frontMatter and layouts for a day now and could use your expertise.
I can get the *.hbs to compile with their data, however there's a 'layout' property in the front-matter that should wrap the generated html with the layout template.
This is all a bit new to me, I'm more used to Angular -- any help would be greatly appreciated!