Skip to content
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

建议把_config.yml添加进.gitignore,改为_config.example.yml文件 #10

Closed
ch3rub1m opened this issue Apr 12, 2017 · 3 comments
Closed

Comments

@ch3rub1m
Copy link
Contributor

这样比较方便主题的更新,你觉得呢

@chenzhiwei
Copy link
Contributor

我倒是建议把所有变量都移动到博客的_config.yaml里面,这样就可以不用修改主题的任何一部分了,同步也非常方便。说下我的具体做法:

  1. 把变量全部移动到博客_config.yaml
...
anatole:
  disqus: xxx
  twitter: xxx

在主题里用config.anatole.disqusconfig.anatole.twitter来引用。

  1. 把主题仓库作为博客仓库的一个module
cd hexo-blog
git submodule add https://github.com/Ben02/hexo-theme-Anatole.git theme/anatole
git add theme/anatole
git commit -m"add theme"
git push
  1. 同步主题
cd hexo-blog/theme/anatole
git pull
cd ../..
git add .
git commit -m"sync theme with upstream"
git push

@ch3rub1m
Copy link
Contributor Author

我目前也是这么做的,但是主题里的config还是会覆盖博客里的config

@chenzhiwei
Copy link
Contributor

@ch3rub1m 做下兼容,加个判断逻辑,优先使用博客里的 config 应该就可以了。

@Ben02 Ben02 closed this as completed in 5e8d5c0 May 11, 2017
godlzr added a commit to godlzr/hexo-theme-Anatole that referenced this issue Feb 12, 2019
Site updated: 2017-02-07 22:28:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants