Forked from https://github.com/y7kim/agency-jekyll-theme
How do I configure GitHub to use non-supported Jekyll site plugins?
- 使用Travis CI, 需要在travis-ci.com上用github.com账号登录授权
- 本地使用bundle exec jekyll build,然后将_site目录当成gh-pages分支推送上去
- from your working folder git init
- git remote add origin [email protected]:userName/userName.github.io.git (UO) or git remote add origin [email protected]:userName/repositoryName.git (P)
- jekyll new . creates your code base
- in _config.yml, set the baseurl parameter to baseurl: '' (UO) or baseurl: '/repositoryName' (P)
- in .gitignore add _site, it will be versioned in the other branch
- jekyll build will create the destination folder and build site.
- git checkout -b sources (UO) or git checkout master (P)
- git add -A
- git commit -m "jekyll base sources" commit your source code
- git push origin sources (UO) or git push origin master (P) push your sources in the appropriate branch
- cd _site
- touch .nojekyll, this file tells gh-pages that there is no need to build
- git init init the repository
- git remote add origin [email protected]:userName/userName.github.io.git (UO) or git remote add origin [email protected]:userName/repositoryName.git (P)
- git checkout master (UO) or git checkout -b gh-pages (P) put this repository on the appropriate branch
- git add -A
- git commit -m "jekyll first build" commit your site code
- git push origin master (UO) or git push origin gh-pages (P)
现在采用的方式是第二种,所以开发的时候需要在master或者是其他不是gh-pages的分支上开发。开发完成,测试没问题后,使用bundle exec jekyll build
生成静态文件。切换到_site目录,将生成的文件提交
需要注意的是,每次bundle exec jekyll build
,都会删除掉_site目录下的.nojekyll
这个文件,所以在提交前,需要将这个文件重置一下再提交。
警告:请不要将gh-page
这个分支合并到master或者是其他开发分支上