Override the theme settings
Hello, In my _config.yml I can override the menu settings but not the sidebar parameter. Has the override limitations for this theme ?
Can you rephrase the question and explain what you want to do, not what you want to override? Do you want to hide the sidebar?
I have the same issue. I have added the following in _config.yml:
theme_config:
twitter: https://twitter.com/m1ke
widgets:
- tagcloud
- recent_posts
menu:
About: /about/
The menu correctly updates to show about/ (though this doesn't actually hide Home & Archives) but the sidebar shows all widgets and Twitter link doesn't show. So it seems not all theme values can be overridden.
Meanwhile a configurable sidebar comes around... I ended up using the package.json script "prebuild": "git apply theme.patch | :"
I generated the patch using git diff --no-index
This will break every minor version, but it's better than what we had in Hexo 4.
This also doesn't work in all environments, like yarn with protected node_modules, PNMP, shared node hosts like Runkit or Glitch.
// My package.json
"re-install": "echo 'Node Bug Workaround.' && rm -r node_modules && npm install",
"postinstall": "rm -r node_modules_orig || :; cp -a node_modules node_modules_orig",
"prebuild": "git apply -p2 --directory='node_modules' patch || echo 'Patch already applied?'",
"build": "hexo generate",
"postbuild": "git diff --no-index node_modules_orig node_modules > patch || :",
Understood! So by default, you need empty default configs in the theme which make it less friendly to start with. Less friendly defaults.
Not sure what you are proposing?
This is primarily a problem with the Hexo API at this point. Though I've seen them state it's a problem with the theme.
With the _config.landscape.yml Hexo 5 endpoint, We currently have no exposed way of removing the Archived menu link, or removing any widgets.
I think what Hexo folks want us to do is use minimal defaults, unless the theme is completely unconfigured.
One way to do that would be to use have a minimal _config.yml, and with softlogic, such as checking if menu: is defined, show demo settings. Instead of configuring it in the internal _config.yml which currently takes precedence over the user level _config.landscape.yml file.