-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Override theme's scheme
from main config [solved]
#44
Comments
# ---------------------------------------------------------------
# Theme Core Configuration Settings
# ---------------------------------------------------------------
# Set to true, if you want to fully override the default configuration.
# Useful if you don't want to inherit the theme _config.yml configurations.
override: false theme_config:
+ override: true
scheme: Pisces
menu:
set from main: / || home In this case u need to copy all NexT settings from NexT config to Hexo config. Or u can use data-files. |
@HuntedCodes if |
@ivan-nginx I just tried commenting out all schemes in Even with Here are updated reproduction steps that I followed: #!/bin/sh
# Initialize a hexo project with `hexo-cli`.
hexo init mytest
cd mytest
npm install
# Install the NeXT theme
git clone https://github.com/theme-next/hexo-theme-next themes/next
sed -i 's/theme: landscape/theme: next/g' _config.yml
# Append the entire NeXT config to main config, under 'theme_config:`
printf "\ntheme_config:\n" >> _config.yml
cat themes/next/_config.yml | sed 's/^/ /g' >> _config.yml
# Enable full theme override
sed -i 's/override: false/override: true/g' _config.yml
# Change scheme from "Muse" to "Pisces". Site should show Pisces scheme.
sed -i 's/scheme: Muse/#scheme: Muse/g' _config.yml
sed -i 's/#scheme: Pisces/scheme: Pisces/g' _config.yml
# Comment out the default scheme in the theme.
sed -i 's/scheme: Muse/#scheme: Muse/g' themes/next/_config.yml
# Change theme menu item to show theme_config is working correctly
sed -i 's/home:/XXXXXXX:/g' _config.yml
# Serve the site on localhost:4000
hexo serve Thanks for pointing out Data Files. I hadn't seen those before. |
I also found this issue — theme config overwrite root config. |
That issue references the pull request that implemented |
Ok, but u comment # ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
#scheme: Muse
#scheme: Mist
#scheme: Pisces
#scheme: Gemini And we add in Hexo config this: theme_config:
scheme: Pisces And still load Muse scheme with this settings? This override by commented |
Sure did, still loads Muse:
Main config file: # Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
.......
theme_config:
# ---------------------------------------------------------------
# Theme Core Configuration Settings
# ---------------------------------------------------------------
# Set to true, if you want to fully override the default configuration.
# Useful if you don't want to inherit the theme _config.yml configurations.
override: true
.......
menu:
XXXXXXX: / || home
.......
# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
#scheme: Muse
#scheme: Mist
scheme: Pisces
#scheme: Gemini
....... NeXT config file: # ---------------------------------------------------------------
# Theme Core Configuration Settings
# ---------------------------------------------------------------
# Set to true, if you want to fully override the default configuration.
# Useful if you don't want to inherit the theme _config.yml configurations.
override: true
.......
# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
#scheme: Muse
#scheme: Mist
#scheme: Pisces
#scheme: Gemini
....... |
Please, try to reproduce steps above. |
I updated my comment above, to remove the extra settings. It shows the config files, from after the steps were reproduced, that generate Muse instead of Pisces. The above script automatically reproduces the steps. |
|
Alright, find it. Need some time for fix, wait.. |
Confirmed. Even though the style shows Muse, the footer says:
|
@HuntedCodes ok, fixed in 1b0b53a Detailed full instructions already updated in data-files docs and for now u can use any options from NexT with The trouble was in If issue solved, close it please. |
scheme
from main configscheme
from main config [fix added]
The fix works. Thanks for the quick remediation! Configuration is so much simpler now, without
#!/bin/sh
# Initialize a hexo project with `hexo-cli`.
hexo init mytest
cd mytest
npm install
# Install the NeXT theme
git clone https://github.com/theme-next/hexo-theme-next themes/next
sed -i 's/theme: landscape/theme: next/g' _config.yml
# Configure NeXT scheme in main config
printf "\ntheme_config:\n scheme: Pisces" >> _config.yml
# Serve the site on localhost:4000
hexo serve |
scheme
from main config [fix added]scheme
from main config [solved]
See also hexojs/hexo#3967 |
I agree and want to create new issue
Expected behavior
The theme's scheme is correctly set from the main
_config.yml
file, using thetheme_config
setting explained here: hexojs/hexo#757Actual behavior
All tested configuration settings can be set from a site's primary
_config.yml
file, except forscheme
.Steps to reproduce the behavior
Here is a short script that reproduces the behavior:
When viewing the site, the theme's
menu
was properly overridden, but the theme's scheme was not.Node.js and NPM Information
node -v && npm -v v8.4.0 5.6.0
Package dependencies Information
Hexo Information
Hexo version
Hexo Configuration
Default, except for
theme_config
at the end.NexT Information
NexT Version:
NexT Scheme:
NexT Configuration:
Default. No modifications: https://github.com/theme-next/hexo-theme-next/blob/7ee28e7d65681f06e509735697573ab857010b11/_config.yml
Other Information
The text was updated successfully, but these errors were encountered: