metalsmith-layouts-by-name
A Metalsmith plugin to enable setting layouts without extension, and layouts as `[layoutName]/index.html`.
Last updated 5 years ago by elcontraption .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install metalsmith-layouts-by-name 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.1.4                                ...           latest (5 years ago)

3 Versions

  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |