Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify parent templates #43

Closed
muchweb opened this issue Feb 7, 2015 · 1 comment
Closed

Add ability to specify parent templates #43

muchweb opened this issue Feb 7, 2015 · 1 comment

Comments

@muchweb
Copy link

muchweb commented Feb 7, 2015

Proposal: add ability to specify parent templates

As a user, I want to be able to specify parent templates for other templates. This is not the same as partials. This functionality already comes as standard in Jeykull as I would expect to have this built-in to templates module.

Example:

  1. src/post1.md:

    ---
    title: My post
    template: post.hbs
    ---
    Hello
  2. templates/post.hbs:

    ---
    template: html.hbs
    ---
    <h1>{{title}}</h1>
    <p>{{contents}}</p>
  3. templates/html.hbs:

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>{{title}}</title>
    </head>
    <body>
        {{{contents}}}
    </body>
    </html>
  4. Expected output:

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>My post</title>
    </head>
    <body>
        <h1>My post</h1>
        <p>Hello</p>
    </body>
    </html>

Maybe related: #27, #26, #21

@ianstormtaylor
Copy link
Contributor

Hey thanks for this sorry for the delay. Now that https://github.com/superwolff has split out this plugin into two separate plugins—layouts and in-place—I'm going to deprecate the metalsmith-templates plugin, so that we can use the simpler ones instead. I'm going to close this issue, but feel free to re-open there!

Added a deprecation notice to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants