Permalink
Browse files

added permalinks and collections

  • Loading branch information...
RobinThrift committed Apr 18, 2014
1 parent ae0e293 commit d72b5c4fde8956eefdf92f5c0736cb4d8795998c
Showing with 15 additions and 5 deletions.
  1. +15 −5 index.js
View
@@ -1,16 +1,26 @@
-var Metalsmith = require('metalsmith'),
- markdown = require('metalsmith-markdown'),
- templates = require('metalsmith-templates'),
- Handlebars = require('handlebars'),
- fs = require('fs');
+var Metalsmith = require('metalsmith'),
+ markdown = require('metalsmith-markdown'),
+ templates = require('metalsmith-templates'),
+ collections = require('metalsmith-collections'),
+ permalinks = require('metalsmith-permalinks'),
+ Handlebars = require('handlebars'),
+ fs = require('fs');
Handlebars.registerPartial('header', fs.readFileSync(__dirname + '/templates/partials/header.hbt').toString());
Handlebars.registerPartial('footer', fs.readFileSync(__dirname + '/templates/partials/footer.hbt').toString());
Metalsmith(__dirname)
+ .use(collections({
+ pages: {
+ pattern: 'content/pages/*.md'
+ }
+ }))
.use(markdown())
+ .use(permalinks({
+ pattern: ':collection/:title'
+ }))
.use(templates('handlebars'))
.destination('./build')
.build()

0 comments on commit d72b5c4

Please sign in to comment.