|
1 |
| -var metalsmith = require('metalsmith') |
2 |
| - ,changed = require('metalsmith-changed') |
3 |
| - ,layouts = require('metalsmith-layouts') |
4 |
| - ,assets = require('metalsmith-assets') |
5 |
| - ,remarkable = require('metalsmith-markdown-remarkable') |
6 |
| - ,syntaxHighlighter = require('./lib/remarkable/highlighter') |
7 |
| - ,remarkablePlugin = require('./lib/remarkable/extender') |
8 |
| - ,pkg = require('./package.json'); |
| 1 | + |
| 2 | +/** |
| 3 | + * Build static HTML files using Metalsmith |
| 4 | + */ |
| 5 | + |
| 6 | +var metalsmith = require("metalsmith") |
| 7 | + ,changed = require("metalsmith-changed") |
| 8 | + ,layouts = require("metalsmith-layouts") |
| 9 | + ,assets = require("metalsmith-assets") |
| 10 | + ,remarkable = require("metalsmith-markdown-remarkable") |
| 11 | + ,remarkableHighlighter = require("./lib/remarkable/highlighter") |
| 12 | + ,remarkableExtender = require("./lib/remarkable") |
| 13 | + ,handlebarsExtender = require("./lib/handlebars")() |
| 14 | + ,pkg = require("./package.json"); |
9 | 15 |
|
10 | 16 | metalsmith(__dirname)
|
11 | 17 | .clean(false)
|
12 | 18 | .use(changed())
|
13 |
| - .source('./src') |
14 |
| - .destination('./build') |
15 |
| - .use(remarkable('full', { |
16 |
| - breaks: true, |
17 |
| - typographer: true, |
18 |
| - html: true, |
19 |
| - langPrefix: '', |
20 |
| - highlight: syntaxHighlighter |
21 |
| - }).use(remarkablePlugin)) |
| 19 | + .source("./src") |
| 20 | + .destination("./build") |
| 21 | + .use(remarkable("full", { |
| 22 | + html: true |
| 23 | + ,breaks: true |
| 24 | + ,typographer: true |
| 25 | + ,langPrefix: "" |
| 26 | + ,highlight: remarkableHighlighter |
| 27 | + }).use(remarkableExtender)) |
22 | 28 | .use(layouts({
|
23 |
| - engine: "handlebars", |
24 |
| - default: "default.hbs" |
| 29 | + engine: "handlebars" |
| 30 | + ,default: "default.hbs" |
| 31 | + ,partials: "partials" |
25 | 32 | }))
|
26 | 33 | .use(assets({
|
27 |
| - source: "./static", |
28 |
| - destination: "./" |
| 34 | + source: "./static" |
| 35 | + ,destination: "./" |
29 | 36 | }))
|
30 | 37 | .build(function (err) {
|
31 | 38 | if (err) {
|
32 | 39 | console.log(err);
|
33 |
| - } |
34 |
| - else { |
35 |
| - console.log('Site build complete!'); |
| 40 | + } else { |
| 41 | + console.log("Site build complete!"); |
36 | 42 | }
|
37 | 43 | });
|
0 commit comments