Skip to content

Instantly share code, notes, and snippets.

@christiannwamba
Created October 19, 2017 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannwamba/73052b3929758dcb59a890aad84ceb03 to your computer and use it in GitHub Desktop.
Save christiannwamba/73052b3929758dcb59a890aad84ceb03 to your computer and use it in GitHub Desktop.
var metalsmith = require('metalsmith');
var permalinks = require('metalsmith-permalinks');
var assets = require('metalsmith-assets');
var collections = require('metalsmith-collections');
var markdown = require('metalsmith-markdown');
var templates = require('metalsmith-templates');
metalsmith(__dirname)
.source('src')
.use(collections({
articles: {
pattern: 'articles/**/*.md',
sortBy: 'date',
reverse: true
}
}))
.use(markdown({
gfm: true,
tables: true,
}))
.use(assets({
source: 'src/assets/',
destination: './'
}))
.use(permalinks())
.use(templates({
engine: 'jade',
directory: 'templates'
}))
.destination('build')
.build(function(err){
if(err){
throw err;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment