As I already mentioned in my other post, you can very easily pass the limitations Github Pages poses you by building the site locally and pushing only the static files.
If you don’t know anything about jekyll, I recommend to first read the docs.
So then you have two choices:
- Pass the source files of your site to the master branch
- Pass the files to the
/docsfolder of the master branch
My choice is to use the
/docs folder as the build place. This way I don’t need to switch and merge branches and my workflow is easier.
Usually, I build the site for local preview using
bundle exec jekyll liveserve --drafts.
--drafts shows drafts along posts.
liveserve command automatically refreshes the page when some file was changed, possible when using this plugin.
When building for publishing I use
JEKYLL_ENV=production bundle exec jekyll build -d 'docs'. The environment variable is for Google Analytics.
-d is for output destination.
To make it easier I have included this two aliases in my
alias release="JEKYLL_ENV=production bundle exec jekyll build -d 'docs'" alias devel="bundle exec jekyll liveserve --drafts"
Also, I use this plugin to make it easier to create and manage drafts and posts.
My usual workflow is:
bundle exec jekyll draft "Your article title here"
- Write the post
bundle exec jekyll publish "Path to your draft here"
As you can see, the create, edit, publish cycle is way easier with the above plugin.
As for now, this setup works best for me.