forked from kvz/bash3boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.lanyonrc.js
61 lines (50 loc) · 1.65 KB
/
.lanyonrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path')
const _ = require('lodash')
module.exports.overrideRuntime = function ({ runtime, toolkit }) {
let preBuilds = []
let postBuilds = []
if (!runtime.isDev) {
preBuilds = preBuilds.concat([
'npm run inject',
])
postBuilds = postBuilds.concat([
// 'npm run redirects',
])
}
// "lanyon": {
// "projectDir": "website",
// "contentScandir": "../",
// "contentIgnore": [
// "website/*.md",
// "website/main.sh"
// ]
// },
// runtime['npmRoot'] = `${__dirname}`
runtime.projectDir = `${__dirname}/website`
runtime.cacheDir = path.join(runtime.projectDir, '.lanyon')
runtime.recordsPath = path.join(runtime.cacheDir, 'records.json')
runtime.assetsSourceDir = path.join(runtime.projectDir, 'assets')
runtime.assetsBuildDir = path.join(runtime.assetsSourceDir, 'build')
runtime.contentScandir = path.join(runtime.projectDir, runtime.contentScandir || '.')
runtime.contentBuildDir = path.join(runtime.projectDir, '_site')
runtime['prebuild:content'] = preBuilds.join(' && ')
runtime['postbuild:content'] = postBuilds.join(' && ')
return runtime
}
module.exports.overrideConfig = function ({ config, toolkit }) {
if (config.runtime.isDev) {
config.jekyll.url = 'http://localhost:3000'
} else {
config.jekyll.url = ''
}
config.jekyll.profile = true
config.jekyll.trace = true
if (config.runtime.isDev) {
config.jekyll.unpublished = true
config.jekyll.future = true
config.jekyll.incremental = true // <-- for clarify; incremental is the default also
} else {
config.jekyll.incremental = false
}
return config
}