Created
June 2, 2017 11:45
-
-
Save growdigital/cd24b00d1c8150af8baa9000d534ac36 to your computer and use it in GitHub Desktop.
index.js of static-site test for metalsmith-rewrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Metalsmith = require('metalsmith'); | |
var markdown = require('metalsmith-markdown'); | |
var layouts = require('metalsmith-layouts'); | |
var permalinks = require('metalsmith-permalinks'); | |
var rewrite = require('metalsmith-rewrite'); | |
Metalsmith(__dirname) | |
.metadata({ | |
title: "My Static Site & Blog", | |
description: "It's about saying »Hello« to the World.", | |
generator: "Metalsmith", | |
url: "http://www.metalsmith.io/" | |
}) | |
.source('./src') | |
.destination('./build') | |
.clean(false) | |
.use(markdown()) | |
.use(rewrite({ | |
pattern: 'blog/**/*.html', | |
filename: 'blog/{date}/build.html', | |
date: 'YYYY/MM' | |
})) | |
.use(permalinks()) | |
.use(layouts({ | |
engine: 'handlebars' | |
})) | |
.build(function(err, files) { | |
if (err) { throw err; } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment