Software Developer at Beijing, China
This site is for me to track my learning of the programming language
I used to be a web application developer, and is familiar with RoR, NodeJS, Python, MySQL, etc. Just starting with the mobile industry :)
About This Site:
- Github Pages:
This site is served on Github as Project Pages.
- Create a repository on github or using your existing repository
- Create a branch
- Then you can host your static site on
There are other kinds pages as User Pages, and Organization Pages. See help on Github.
This site is build with Jekyll, which helps you to transform plain text to static website. It is officially supported by Github. See https://help.github.com/articles/using-jekyll-with-pages/
Unfortunately, Github do not allow Jekyll plugins for security reasons. So I have added some rake tasks as workaround to make my plugins works.
I write a plugin as
_plugins/tag_posts.rb, which generates list of posts of
tags, so you can visit
/tags/code.html to get all posts with the tag
To make it work, the rake command
build will generate files in
normal, and copy the
tags/*, which will be copied back on
Github by Jekyll.
- Useful Tips:
rake post title='your title' to create a new post in
Accepted params are:
- title: e.g. title='new to swift'
- tags: e.g. tags='code,algorithm'
- date: e.g. date='2014-01-01'
rake draft title='your title' to create a new draf in
_drafs. Drafts will
not appear on your posts list on Github.
rake publish title='part of title' will convert an existing draf to a post.
It will find the matched draf and ask you to select the right one.
rake run to run locally, including drafts, and you can preview your site at
rake build to generate the site static files into
_site, it will also copy
tags to make the
tag_posts plugin work. Most of the time
you do not need to run this.
rake commit m='your commit message' to commit all your changes, which will
rake build for you, so files generated by your plugins will
rake deploy to push your changes to github. If you have
uncommitted changes, this will automatically commit for you. You can set commit
message by adding
m='your commit message' part, otherwise it will use the
default commit message. It is safe if there is nothing to commit.
So the basic flow for you to write a post is:
rake post title='hello world'to create a post with title "hello world"
- Then you find the file under
_postsand edit it
rake runto preview it locally at
rake deploy m='new post hello world'to commit and push the changes to Github