Comments (15)
Alright, find it. Need some time for fix, wait..
from hexo-theme-next.
# ---------------------------------------------------------------
# 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.
from hexo-theme-next.
@HuntedCodes if scheme: Muse
option will be commented in default NexT config, all works fine?
from hexo-theme-next.
@ivan-nginx I just tried commenting out all schemes in themes/next/_config.yml
.
Even with override: true
, and all theme settings copied to the main _config.yml
, Hexo still uses Muse.
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.
from hexo-theme-next.
I also found this issue — theme config overwrite root config.
So, Hexo first read scheme: Pisces
from root config and after that Hexo read default scheme: Muse
from NexT config and override by it.
from hexo-theme-next.
That issue references the pull request that implemented theme_config
(hexojs/hexo#757). There is also PR to have it documented (hexojs/site#634).
from hexo-theme-next.
Ok, but u comment #scheme: Muse
option in default Next config, right?
So, we must get on out:
# ---------------------------------------------------------------
# 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 #scheme: Pisces
or what? A little bit strange.
Try to clear all commented schemes in default NexT config, still Muse loaded?
from hexo-theme-next.
Sure did, still loads Muse:
- All schemes were commented out in
themes/next/_config.yml
. - All configuration settings were copied from
themes/next/_config.yml
to_config.yml
, undertheme_config
. - Pisces was enabled in
_config.yml
. - Set
override: true
in boththemes/next/_config.yml
and_config.yml
.
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
.......
from hexo-theme-next.
Please, try to reproduce steps above.
from hexo-theme-next.
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.
from hexo-theme-next.
- Don't need to touch
override
option anymore. - When u see generated Muse theme, in the footer u see «Theme — NexT.Muse v6.0.1» or «Theme — NexT.Pisces v6.0.1»? Because i trying to change on Gemini and see Gemini in footer, but current visual scheme is still Muse. Can u confirm it?
from hexo-theme-next.
Confirmed. Even though the style shows Muse, the footer says:
Theme — NexT.Pisces v6.0.1
from hexo-theme-next.
@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 theme_config
+ 2 spaces indent in main Hexo config (as u used above, without override
option (it's now only for data-files)) — all added options will be rewrited.
The trouble was in hexo-renderer-stylus
which by default get all settings from theme's config, not from main Hexo config, without any fallback.
If issue solved, close it please.
from hexo-theme-next.
The fix works. Thanks for the quick remediation!
Configuration is so much simpler now, without override
or touching the theme's config file:
- Initialize a Hexo project
- Install the NeXT theme
- Add
theme_config
withscheme: Pisces
- Serve the site
#!/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
from hexo-theme-next.
See also hexojs/hexo#3967
from hexo-theme-next.
Related Issues (20)
- click tags btn but get 404 page HOT 1
- Archive page cannot be rendered and displayed normally. HOT 1
- NexT note with customize link color HOT 1
- 如何添加博客分享功能? HOT 2
- <tr> tag with class="header" displayed incorrectly HOT 1
- 如何更换自定义字体 HOT 1
- ~/source/_data/footer.swig can't work as well HOT 1
- 能不能在主题中增加一个按标签进行分类,在搜索框前面增加选择标签的下拉框,进而实现分类搜索的功能?? HOT 1
- 移动端国内访问博客只显示框架,不显示文字 HOT 2
- 使用utteranc作为评论系统, 点击github注册按钮后, 总是返回到http://example.com/... 然后页面找不到 HOT 2
- 自定义:添加代码块折叠
- 空格宽度不一样 HOT 2
- 能否支持配置备案跳转地址 HOT 1
- Gitter集成问题 HOT 1
- insert a inline image in text, but the image and text are not aligned horizontally HOT 1
- next 主题如何设置首页为Archives HOT 1
- 有中文说明的config.yml吗? HOT 1
- 将官网链接替换为 theme-next.js.org HOT 2
- 關於中文段首空格與豎排的支持諮詢。 HOT 1
- How can add some padding or can be called as margin bottom between each posts on the home page? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-next.