yaml front matter not working in 6.11.0 ?

46 views
Skip to first unread message

Pete Schirmer

unread,
Nov 6, 2012, 8:45:48 PM11/6/12
to doc...@googlegroups.com
previously for template files (eco / handlebars / whatever) I was able to start the file with a yaml section, now its generating errors when I do so.. any ideas why? 

ie: 

---
name:'module test'
content: {a:'foo', b:'bar'}
---
<div>
<h1>{{document.name}}</h1>
<ul>
<li>{{document.content.a}}</li>
<li>{{document.content.b}}</li>
</ul>
</div>

generates the error: 

warning: Rendering partial failed: module_test.html.hb. The error follows:
warning: An error occured: Unable to parse. undefined
error: Failed to read the file: /src/partials/module_test.html.hb



also related, is there a way to include the data as an external json file? 

Pete Schirmer

unread,
Nov 6, 2012, 9:08:27 PM11/6/12
to doc...@googlegroups.com
might have something to do with version 6.9.2 swapping yaml for yamljs ?

I tried reverting but didn't seem to fix so maybe not related... 

Pete Schirmer

unread,
Nov 8, 2012, 1:06:08 AM11/8/12
to doc...@googlegroups.com
I suppose its not yaml per se but the file meta data?

Pete Schirmer

unread,
Nov 8, 2012, 1:18:58 PM11/8/12
to doc...@googlegroups.com
should have noted this did not happen without this part:


---
name:'module test'
content: {a:'foo', b:'bar'}
---



Pete Schirmer

unread,
Nov 12, 2012, 6:17:32 PM11/12/12
to doc...@googlegroups.com
GAH finally figured it out, it's a whitespace problem, needs a space after the colon: 

---
name: 'module test'
meta_data: {a:'foo', b:'bar'}
---

Benjamin Lupton

unread,
Nov 13, 2012, 8:13:33 PM11/13/12
to doc...@googlegroups.com
Hehe. Yeah, the previous YAML parser we use to use was very lenient however gave really weird results sometimes. The new YAML parser is a lot stricter but much more stable. It'll also help you figure out the error as well sometimes. :)
Reply all
Reply to author
Forward
0 new messages