Locally building and pushing jekyll site to github pages

家住魔仙堡 提交于 2019-11-30 16:28:00

You need to push only the content of the _site folder. Nothing else, nor the folder itself.

If you are setting up a project site, push the content to the gh-pages branch. If it's your user website, the repo must be named username.github.io and your site root needs to be the master branch.

Let me know how it goes! :)

Hope to have helped!

Here a windows batch file that pushes generated files back to github. Name it site_publish.bat and put it into the root of your project.

@echo off
cd /d "%~dp0"
rmdir _site /s /q
call jekyll build
git --git-dir=.git --work-tree=_site add --all
git --git-dir=.git --work-tree=_site commit -m "autogen: update site"
git --git-dir=.git --work-tree=_site push

You may want to try jgd command line, which automates all the steps suggested by other answers, in one simple call:

$ jgd

The site will be packaged and then deployed to the gh-pages branch of your repo, provided you have all permissions configured. More about it in this blog post of mine: Deploy Jekyll to GitHub Pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!