Depending if you deal with a User/Organization (UO) site or a Project site (P), do :
- 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)
You now have something like Octopress does. Look at their rake file, there are some nice comments inside.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…