zddhub's blog www.zddhub.com
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.blogs @ 39ee30e
.gravid @ e9ba2b7
_includes
.gitignore
.gitmodules
404.html
CNAME
Gemfile
LICENSE.txt
README.md
_config.yml
_layouts
_posts
_sass
about.md
archive.md
assets
favicon.ico
feed.xml
index.md
journal
link.md
publish_blog
reward.md
timeline.md
yarn-error.log

README.md

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 https://github.com/zddhub/zddhub.github.io .blogs
    git submodule add -b master https://github.com/zddhub/gravid .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/about.md about.md
    ln -s .blogs/archive.md archive.md
    ln -s .blogs/index.md index.md
    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

Usage

  • Clone repo with submodules (once at first time)
    git clone --recursive https://github.com/zddhub/zddhub.github.io.git
  • 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 https://github.com/zddhub/zddhub.github.io.git -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.

Troubleshooting

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.

Contact

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