Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

zddhub's blog

I want to write in a clean workspace, that only includes plain text (such as: markdown file) and assets referenced in articles.

Gem-based Jekyll theme is a good choice but Github doesn't support customized theme now (Supported theme list).

so ...

Blogs and Jekyll pages separation solution

My site is separated into three parts:

  • Blogs - Only include markdown files and assets (also support gem-based theme)
  • Gravid - A simple and beautiful jekyll theme.
  • Jekyll pages - Above two parts are included by git submodule, and this repo just link important files for Jekyll pages.

How to do

  • Add submodules to Jekyll site.
    git submodule add -b blogs .blogs
    git submodule add -b master .gravid
  • Symlink important files to Jekyll site.
    ln -s .blogs/posts _posts
    ln -s .blogs/assets assets
    ln -s .blogs/journal journal
    ln -s .blogs/
    ln -s .blogs/
    ln -s .blogs/
    ln -s .blogs/_config.yml _config.yml

    mkdir -p _includes # the symlinked files under `includes` cannot be used.
    ln -s .gravid/_layouts _layouts
    ln -s .gravid/_sass _sass
    ln -s .gravid/404.html 404.html
    ln -s .gravid/ads.txt ads.txt


  • Clone repo with submodules (once at first time)
    git clone --recursive
  • After you updated and pushed Blogs or Gravid, run ./publish_blog to trigger Jekyll pages on Github side.

Gem-based blog

If Github page supports customized theme later, or in your local environment, You can use gem-based style.

git clone -b blogs

And add this line to your Jekyll site's _config.yml:

theme: gravid

And then execute:

$ bundle

Or install it yourself as:

$ gem install gravid

Run bundle exec jekyll serve and open your browser at http://localhost:4000.


If you want debug in local (master branch) with jekyll server --watch, you will find some INFO like this:

    ** ERROR: directory is already being watched! **

Don't worry, this is just a Warning.


If you have any question or idea, please email to me.