-
Notifications
You must be signed in to change notification settings - Fork 430
Open
Description
The inheritance doesn't work as specified here.
Having three template files:
{{! header.mustache }}
<head>
<title>{{$title}}Default title{{/title}}</title>
</head>
{{! base.mustache }}
<html>
{{$header}}{{/header}}
{{$content}}{{/content}}
</html>
{{! mypage.mustache }}
{{<base}}
{{$header}}
{{<header}}
{{$title}}My page title{{/title}}
{{/header}}
{{/header}}
{{$content}}
<h1>Hello world</h1>
{{/content}}
{{/base}}
Run hulk from the command line (something like this, you get the idea):
npm install hogan.js
cat "var Hogan = require('hogan.js');" > script.js
hulk *.mustache >> script.js
cat "templates['mypage'].render()" >> script.js
Run with node: node script.js. The rendered result is empty string.
I noticed that the in hulk compiled JS script, templates['mypage'] correctly references a partial called 'base':
> templates['base']
{ r: [Function],
c: undefined,
options: {},
text: '',
partials: {},
subs: { header: [Function], content: [Function] },
buf: '' }
>
> templates['header']
{ r: [Function],
c: undefined,
options: {},
text: '',
partials: {},
subs: { title: [Function] },
buf: '' }
>
> templates['mypage']
{ r: [Function],
c: undefined,
options: {},
text: '',
partials: { '<base11': { name: 'base1', partials: [Object], subs: [Object] } },
subs: {},
buf: '' }
But it seems there is still something missing to connect the dots.
node version: v5.6.0
hogan.js version: 3.0.2
hulk version: 3.0.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels