Last active
February 7, 2018 14:41
-
-
Save dotmh/7b17c61bcfce80ee433ac251c4f9d4d0 to your computer and use it in GitHub Desktop.
Metalsmith
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Metalsmith = require('metalsmith'); | |
var Layouts = require('metalsmith-layouts'); | |
var Sass = require('metalsmith-sass'); | |
var Copy = require("metalsmith-copy"); | |
var Watch = require("metalsmith-watch"); | |
var DiscoverPartials = require('metalsmith-discover-partials'); | |
var SRC = "./src"; | |
var VIEWS = SRC+'/_views'; | |
var OUT = "build"; | |
Metalsmith(__dirname) | |
.source(SRC) | |
.destination(OUT) | |
.ignore(['_scss', '_views']) | |
.clean(true) | |
.use(DiscoverPartials({ | |
directory : './partials', | |
pattern: '/\.hbs$/' | |
})) | |
.use(Layouts({ | |
pattern: "**/*.html", | |
directory : VIEWS+'/layouts' | |
})) | |
.use(Sass({ | |
outputDir: 'assets/css' | |
})) | |
.use(Copy({ | |
pattern: 'assets/*', | |
directory: 'assets' | |
})). | |
use(Watch({ | |
paths : {"${source}/**/*": true} | |
})) | |
.build(function(err, files){ | |
if(err) { | |
throw err; | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./src | |
├── _sass | |
│ └── main.scss | |
├── _views | |
│ └── layouts | |
│ └── layout.hbs | |
├── assets | |
│ ├── css | |
│ ├── img | |
│ │ └── background.jpg | |
│ └── js | |
│ └── timezz.min.js | |
├── index.html | |
└── partials | |
└── footer.hbs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment