metalsmith-layouts-add-extension
A Metalsmith plugin that appends any given extension to the layout property of any post that does not already have an extension. This makes it easy to automatically fix any imported posts that might not have an extension appended, or quickly switch the extension of all posts to test a different templating language.
Installation
npm install metalsmith-layouts-add-extension
Usage
var metalsmith = ;var addExtension = ;var layouts = ; // Plugin should be used before metalsmith-layoutsmetalsmith ;
This will turn any files that have a layout property without an extension like:
layout: index
to
layout: index.html
but any of the following would be left alone:
layout: index.htmllayout: index.extension1.extension2.html
unless the force option is used: