Skip to content

Commit 7674ce7

Browse files
committed
Switch order config files are loaded in netlify build
This allows admins to override anything generated by the netlify build plugin in _config.yml Whereas previously, the generated values would override anything specified in _config.yml
1 parent 34c9dba commit 7674ce7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ _site
44
_config.dev.yml
55
node_modules
66
*.map
7+
_config.ci.yml

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build]
2-
command = "jekyll build --config _config.yml,_config_override.yml"
2+
command = "jekyll build --config _config.ci.yml,_config.yml"
33
publish = "_site"
44
environment = { JEKYLL_ENV = "production" }
55

netlify/plugins/netlify-jekyll-metadata/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const onPreBuild = async function () {
77
const repoNameWithOwner = repoUrl.pathname.replace(/^\/+/, '')
88
const branch = process.env.BRANCH
99

10-
const fileName = '_config_override.yml'
1110
const fileContents = `repository: ${repoNameWithOwner}\nurl: ${siteUrl}\nbranch: ${branch}\nbaseurl: ""`
11+
const fileName = '_config.ci.yml'
1212
return fs.promises.writeFile(fileName, fileContents)
1313
}

0 commit comments

Comments
 (0)