Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
More comments added
  • Loading branch information
diagramatics committed Jan 2, 2017
commit a273e24693a16459a34165a50dbe759e959d0d92
10 changes: 7 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,25 +212,29 @@ function githubLinks (options) {
}
}

// This function builds the layouts folder for all the Stylus files.
function buildLayouts () {
console.time('[metalsmith] build/layouts finished')

fs.mkdir(path.join(__dirname, 'build'), () => {
fs.mkdir(path.join(__dirname, 'build', 'layouts'), () => {
const metalsmith = Metalsmith(__dirname)
metalsmith
// Sets the build source as the locale folder.
// Sets the build source as /layouts/css.
.source(path.join(__dirname, 'layouts', 'css'))
// Deletes Stylus partials since they'll be included in the main CSS file
// anyways.
// Deletes Stylus partials since they'll be included in the main CSS
// file anyways.
.use(filterStylusPartials())
.use(stylus({
compress: true,
paths: [path.join(__dirname, 'layouts', 'css')],
use: [autoprefixer()]
}))
// Pipes the generated files into /build/layouts/css.
.destination(path.join(__dirname, 'build', 'layouts', 'css'))

// This actually executes the build and stops the internal timer after
// completion.
metalsmith.build((err) => {
if (err) { throw err }
console.timeEnd('[metalsmith] build/layouts finished')
Expand Down