-
Notifications
You must be signed in to change notification settings - Fork 4.7k
allow merging of yaml, toml, js config #1374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* allows the merging `yaml`, `toml`, `js` config * update documentation section My Team manages eg. `themeConfig.nav` in `config.yml` for readability and ease of use. However some advanced js syntax can’t be managed by `yaml` like `extendMarkdown: md => {md.use(…)}`. I would like to have two configuration files. `config.yml` and `config.js` work side by side. One for simple theme config and the js for advanced configuration. :link: #804
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This merge
is unreasonable and will cause issues, because the config of vuepress allows users to export a function.
Thus, I think that you should do this merge in your config.js
.
@@ -63,7 +63,7 @@ module.exports = ctx => ({ | |||
} | |||
}, | |||
plugins: [ | |||
['@vuepress/i18n-ui', !ctx.isProd], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've tested several scenarios and looked at the netlify build and output. I did't wanted to change the vuepress config. I've awaited some constructive feedback, this is why I've asked this in the description.
Other information:
From reading the docs I assumemodule.export
is an object. Is this fact correct? If not, I would need help on how to elegant require an object or function.
@@ -27,7 +27,7 @@ If you've got the dev server running, you should see the page now has a header w | |||
Consult the [Config Reference](../config/README.md) for a full list of options. | |||
|
|||
::: tip Alternative Config Formats | |||
You can also use YAML (`.vuepress/config.yml`) or TOML (`.vuepress/config.toml`) formats for the configuration file. | |||
You can also split config and use YAML (`.vuepress/config.yml`) or TOML (`.vuepress/config.toml`) formats for the configuration. All configuration files will be merged together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you should emphasize that this is only "Shadow Merge".
Thank you, important information.
Probably, but because other folks found this useful too I would try to get this working out of the box. @ulivz, you're a vuepress and js professional. Myself aren't. Share your knowledge ✌️ |
Summary
allows the merging of
yaml
,toml
andjs
configMy Team manages eg.
themeConfig.nav
inconfig.yml
for readability and ease of use. However some advanced js syntax can’t be managed byyaml
likeextendMarkdown: md => {md.use(…)}
.I would like to have two configuration files.
config.yml
andconfig.js
work side by side.One for simple theme config and the js for advanced configuration.
My Setup simplified
In the
config.yml
contains the config basic documentation authors can edit. Theconfig.js
contains advanced configuration for markdown and plugins a basic author better don't touch 😉🔗 #804
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
From reading the docs I assume
module.export
is an object. Is this fact correct? If not, I would need help on how to elegant require an object or function./cc @ekoeryanto