-
-
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
feat: disable deep merging theme configs by default #4154
Conversation
I don't think it is a common case.
IMHO, the case @Teekivi provided is due to the bad-designed theme (which provides default items instead of giving example in Providing a case: # theme's _config.yml
a:
b:
menu:
d: 'e'
f: 'g'
sidebar:
h: 'i' # _config.yml
theme_config:
a:
b:
menu:
d: 'e' Then they will be no # theme's _config.yml
# No less than 2 levels, which means override any 1st level won't affect other configurations
a:
b: e
c: f
d: g |
@SukkaW I'm quite new to the Hexo world, so you are probably right about my problem not being very common. I understand that the "case" you provided is not meant as a good example, but it does show the limitations posed by default deep merge. As I said in #3967 (comment) deep merge makes it impossible to reorder or omit predefined dictionary/menu items solely via I think that deep merge brings a lot more good than bad. But in my case, I experienced the less prevalent downside of it. So I think that as a possibility, we could expect future theme development to take the new behavior into account and not change it. Or we could make it globally opt-out or opt-in (the latter being this case), or figure out a good way to enable/disable deep merge selectively. |
👍
I could introduce an option, which is a reverse of this PR. But that option is more of a workaround for a theme which has invalid defaults, so the option wouldn't be useful. |
I have encountered this problem in the theme NexT: iissnan/hexo-theme-next#1861 theme-next/hexo-theme-next#878 |
This is an issue on the landscape default theme... All the menu items are loaded by default. I think there are a few compounding problems
|
What does it do?
Continuation of #3967. Requested by #3967 (comment) @Teekivi
deep merging theme.config and config.theme_config is considered less common use case.
cc #3964 @cmpute
Introduce a new option:
How to test
Screenshots
Pull request tasks