0.1.4 • Published 8 years ago

metalsmith-layouts-by-name v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Metalsmith Layouts by Name

A Metalsmith plugin to enable setting layouts without extension, and layouts as [layoutName]/index.html.

Installation

$ npm install metalsmith-layouts-by-name

Usage

var layouts = require('metalsmith-layouts');
var layoutsByName = require('metalsmith-layouts-by-name');
var metalsmith = require('Metalsmith');

// Make sure you add this plugin before metalsmith-layouts:
metalsmith
    .use(layoutsByName({
        // Optional: path to your layouts directory, `layouts` by default
        directory: 'path/to/layouts'
    }))
    .use(layouts());

Now, if your layout is set like this:

---
layout: my-layout
---

Metalsmith will first check for my-layout.html. If that file does not exist, my-layout/index.html will be checked.

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago