Skip to content

Commit 6e4f9f7

Browse files
committed
Added AsciiDoc support
1 parent 944e4a0 commit 6e4f9f7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

build.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var Metalsmith = require("metalsmith");
22
var markdown = require("metalsmith-markdown");
3+
var asciidoctor = require("metalsmith-asciidoctor");
34
var less = require("metalsmith-less");
45
var ignore = require("metalsmith-ignore");
56
var assets = require("metalsmith-static");
@@ -26,6 +27,13 @@ metalsmith.use(markdown({
2627
// optional marked options
2728
}));
2829

30+
/*
31+
* Transform Asciidoc files to HTML
32+
*/
33+
metalsmith.use(asciidoctor({
34+
pattern: "**/*.adoc"
35+
}));
36+
2937
/*
3038
* Adds a 'excerpt' property to all pages. This will be used
3139
* to display excerpts for the news entries.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
"build": "node build.js",
77
"dev": "npm run serve & npm run watch",
88
"serve": "browser-sync start --server build --no-open",
9-
"watch": "nodemon -e md,html,js,less,json -w src -w conf -w lib -x 'npm run build && browser-sync reload'"
9+
"watch": "nodemon -e md,html,js,less,json,adoc -w src -w conf -w lib -x 'npm run build && browser-sync reload'"
1010
},
1111
"devDependencies": {
1212
"bootstrap": "3.3.7",
1313
"browser-sync": "^2.18.8",
1414
"handlebars": "4.0.5",
1515
"metalsmith": "1.7.0",
16+
"metalsmith-asciidoctor": "^1.1.0",
1617
"metalsmith-better-excerpts": "^0.1.7",
1718
"metalsmith-ignore": "0.1.2",
1819
"metalsmith-less": "2.0.0",

0 commit comments

Comments
 (0)