segment-boneyard / metalsmith-templates

A metalsmith plugin to render files with templates.
46 stars 22 forks source link

Handlebars syntax in files in the `src` folder isn't processed #34

Closed ismay closed 10 years ago

ismay commented 10 years ago

I'd like to use handlebars syntax in my source files (the files in ./src) as well as in my template files (in `./templates). Right now, this doesn't seem to be working for me.

For example:

./src/index.html


---
pagetitle: Page title
template: default.html

---
<h1>Page contents</h1>
    <h2>Partials</h2>
    {{> header }}
    {{> footer }}

and ./templates/default.html

<h1>Template contents</h1>
    <h2>Partials</h2>
    {{> header }}
    {{> footer }}
{{{ contents }}}

Is processed to ./dist/index.html:

<h1>Template contents</h1>
    <h2>Partials</h2>
    <h2>Header</h2>
    <h2>Footer</h2>

<h1>Page contents</h1>
    <h2>Partials</h2>
    {{> header }}
    {{> footer }}

Is it normal for metalsmith not to process the files in src (other than applying the template to them)? And if so, would it be possible for metalsmith to do so?


My source code is here: https://github.com/superwolff/cape/tree/handlebars-layouts And I don't think this issue is related to issue 24, but correct me if I'm wrong

ismay commented 10 years ago

So it seems that passing inPlace: true to metalsmith-templates renders all handlebars syntax in the files in ./src, but then it does not apply the template from ./templates (as specified in each files' front-matter) to the rendered file.

ismay commented 10 years ago

Also, this issue seems to be a duplicate of #22 and https://github.com/segmentio/metalsmith/issues/75, closing.