-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(theme): deep merge configs #3967
Conversation
Thanks! |
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.
LGTM!
Verified in a test blog. |
Is it possible to (selectively) opt out of deep merging theme configs? I am using a theme called Hermes which uses a dictionary for its menu. It has some menu items predefined. I want to replace all of those with my items. Due to deep merging, I end up with a menu that contains both the predefined and my items. |
would modifying the theme's config.yml (instead of |
Yes, modifying the theme's config.yml would indeed resolve issue. But having to modify the theme's source code kind of defeats the purpose of
Enforcing deep merge of configs without making it opt-in or opt-out makes using I imagine that lots of themes come with example menus etc to showcase them out-of-the-box. If a menu is defined using a dictionary and the user happens to want to use exactly the same menu item names and in that same order as the predefined one, the user is in luck. In other cases, they'll want to omit and/or reorder predefined items, both of which are currently impossible via |
awesome |
What does it do?
Fixes #3964
How to test
cc @cmpute
rm package-lock.json && rm -rf node_modules/
npm install
hexo clean && hexo server
(orhexo generate
if relevant)theme.a
should have{ b: 3, c: 2}
Maintainers:
Pull request tasks