0.6.0 • Published 8 years ago

metalsmith-sense v0.6.0

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

metalsmith-sense

A batteries-included distribution of metalsmith available as a plugin.

Status

Metalsmith is a very useful static-site generator with almost all functionality provided by plugins. Most of the time, you will need the same set of functionality out of a site builder:

  • CSS (metalsmith-sense/sass):

    • compile using a modern pre-processor when needed. (.sass, .styl)
    • don't worry about vendor prefixes. (autoprefixer)
    • compress in production.
  • HTML (metalsmith-sense/html):

    • compile from modern templating languages. (handlebars, jade)
    • support Markdown.
    • allow HTML classes with markdown-it-decorate.
    • support for layout templates. (layouts/)
    • support for partials. (partials/)

Compatible with Metalsmith 2.x.

Documentation →

API

This module provides 3 Metalsmith plugins:

  • metalsmith-sense/sass - for Sass compilation and such
  • metalsmith-sense/html - for Markdown/Jade/Handlebars, layouts, etc
  • metalsmith-sense - combination of both

You can use them in metalsmith.json:

{
  "plugins": {
    "metalsmith-sense/sass": {},
    "metalsmith-sense/html": {}
  }
}

Or via JavaScript:

var app = Metalsmith(__dirname)
  .source('./src')
  .destination('./public')
  .use(require('metalsmith-sense')())

  // or use them separately:
  .use(require('metalsmith-sense/sass')())
  .use(require('metalsmith-sense/html')())

Available options:

  • sass(Object) options to pass onto the Sass parser
  • markdown(Object) options to pass onto markdown-it. defaults to html: true, typographer: true
  • engine(String) either 'jade' or 'handlebars'. defaults to handlebars.
  • partials(String) directory for handlebars partials. defaults to partials

Thanks

metalsmith-sense © 2015+, Rico Sta. Cruz. Released under the MIT License. Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz