fix(theme): deep merge configs#3967
Conversation
|
Thanks! |
|
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 installhexo clean && hexo server(orhexo generateif relevant)theme.ashould have{ b: 3, c: 2}Maintainers:
Pull request tasks