I set up another blog as a backup (in case Farbox goes away): binge. Here's a quick overview of how I built it.
1. Local Setup
Setting up Jekyll locally is similar to creating a new Rails project. First, install Jekyllsudo gem install jekyll
Then create a Jekyll projectjekyll new test
Go into the project and start the servercd testjekyll s
Open 127.0.0.1:4000 in your browser to preview it. Your local setup is done.
2. Publishing to GitHub
Sign in to GitHub and create a repository named test.github.io (replace test with your GitHub username)
Put the local project under Git version control and push it to GitHub by running these commands locally
|
|
After 10 minutes, visit http://test.github.com and your basic blog is ready.
3. Adding a Custom Domain
Besides the default domain GitHub provides, you can add a custom domain in two steps
- Run dig on test.github.io to find the IP in its A record, then point test.com to that IP
- In the test directory, run
echo "test.com" > CNAME
Push the change to the remote branch by running these commands:
|
|
4. Writing Posts
Each Jekyll post is a Markdown file stored in the _posts directory. Post filenames follow a fixed format, and Jekyll generates each post's permalink from its filename. The format is YYYY-MM-DD-post-name.md, where YYYY is the year, MM is the month, and DD is the day. For example: 2015-05-18-test.md
Besides the filename format, each post needs front matter before you write it. Front matter goes between two lines of three dashes. In it, you can set predefined global variables, and Jekyll uses them to generate the post page. Here's the front matter for this post:
|
|
For other front matter settings, see frontmatter
For Markdown syntax, see A Markdown Guide for Beginners
5. Adding Comments
For comments, I used the well-known service Disqus. The usual steps: sign up, sign in, get the code, and add it to the page.
In Disqus, go to Settings > Add Disqus To Site, click Start Using Engage, open Site profile, fill in the details, choose Auto for Category, and click Finish registration. Then paste the code between the </article> and </div> tags in _layouts/post.html
And that's a free blog, up and running. Of course, this is only the beginning. The real goal is to keep writing. Happy Blogging :)
