mirror of
https://github.com/rmaake1/httpstatuses.git
synced 2024-11-20 01:12:43 +01:00
92f1bdacbf
Need a better favicon, but alas, no ideas. What could it conceivably be?
58 lines
1.3 KiB
JavaScript
58 lines
1.3 KiB
JavaScript
var Metalsmith = require('metalsmith');
|
|
var markdown = require('metalsmith-markdown');
|
|
var collections = require('metalsmith-collections');
|
|
var layouts = require('metalsmith-layouts');
|
|
var branch = require('metalsmith-branch');
|
|
var sass = require('metalsmith-sass');
|
|
var elevate = require('metalsmith-elevate');
|
|
var ignore = require('metalsmith-ignore');
|
|
var collectionGrouping = require('metalsmith-collection-grouping');
|
|
var fingerprint = require('metalsmith-fingerprint-ignore');
|
|
|
|
var metalsmith = Metalsmith(__dirname);
|
|
metalsmith
|
|
.source('contents')
|
|
.destination('build')
|
|
|
|
.use(collections({
|
|
pages: {
|
|
pattern: '*.md'
|
|
},
|
|
codes: {
|
|
pattern: 'codes/*.md',
|
|
sortBy: 'code'
|
|
}
|
|
}))
|
|
|
|
.use(collectionGrouping({
|
|
codes: {
|
|
groupBy: 'set', // set instead of class, because class is a reserved word...
|
|
meta: 'codes/classes.json'
|
|
}
|
|
}))
|
|
|
|
.use(branch('*.scss')
|
|
.use(sass())
|
|
)
|
|
|
|
.use(fingerprint({
|
|
pattern: ['style.css', 'favicon.ico']
|
|
}))
|
|
|
|
.use(branch('**/*.md')
|
|
.use(markdown())
|
|
.use(layouts({
|
|
engine: 'jade',
|
|
directory: 'templates',
|
|
default: 'code.jade',
|
|
pretty: true
|
|
}))
|
|
)
|
|
|
|
.use(elevate('codes/*.html'))
|
|
.use(ignore('**/*.json'))
|
|
|
|
.build(function (err) {
|
|
if (err) throw err;
|
|
console.log('Build successful!');
|
|
}); |