Hosting sites for free on Github

In this blog I would like to explore how we can make use of GIT Pages to host websites for free, and not just hosting, GIT also makes it easy to manage your pages using prose.io CMS Lite tool.

Our software stack will be as follows

Github Pages hosting
http://prose.io/ CMS lite tool to edit pages
Google Analytics
Disqus for blog post comments
At a minimum you need to buy a domain name if would like to avoid accessing your site with git pages url, else you can access the site using http://USERNAME.github.io/
Prerequisite (Optional)

I have decided to manage my blog using Jekyll, but this is not mandatory, you may create a basic html site and host it on GIT. Github internally uses Jekyll engine and hence you have the luxury to code the page in Jekyll as well.

Since in this example we will explore building a blog and Jekyll makes it very easy to build a blog aware site
First install ruby and jekyll

Install rubygems followed by jekyll, on ubuntu I had to run following commands

sudo yum install ruby rubygems
sudo gem install jekyll
root@search:/home/search/git# git clone https://github.com/dbtek/jekyll-bootstrap-3 hariinfo.github.io

It is a good idea to begin with a template, I decided to make use of jekyll-bootstrap-3 which is a bootstrap 3 clone of Jekyll bootstrap
I got following error while installing jekyll as sudo account, so make sure you install jekyll as root.

ERROR:  While executing gem ... (Errno::EACCES) Permission denied - /var/lib/gems

Prepare your system to host jekyll powered blogger locally

$ mkdir jekyll_workspace
$ cd jekyll_workspace/
~/jekyll_workHost your site / blog on the internet
space/ $sudo gem install jekyll jekyll-import

-- This will take a while before importing all the libraries

~/jekyll_workspace $ jekyll new gblog

Migrating the existing Blog

First we need to install the jekyll-import gem module as follows

gem install jekyll-import

You can read more about this module here https://github.com/jekyll/jekyll-import

Blogger provides an option to export entire blog as Atom feed, but unfortunately there is no
jekyll importer as of this writing to import an ATOM feed.

Export the blog as RSS feed
http://<NAME>.blogspot.com/feeds/posts/default?alt=rss&max-results=<RECORDS>
Replace name with your blog name and RECORDS with the number of posts you would like to export.
E.g. I used this to export my blog and upto 500 posts, there isn't a nice way to export all so you will
have to count all the posts before exporting all records.

curl -o gdata.xml http://techhari.blogspot.com/feeds/posts/default?alt=rss&max-results=500

ruby -rubygems -e 'require "jekyll-import";JekyllImport::Importers::RSS.run({"source" => "gdata.xml"})'
Start the server and access localhost:4000 to visit the new jekyll powered blog.


~/jekyll_workspace/gblog $ jekyll serve
Configuration file: /home/hari/jekyll_workspace/gblog/_config.yml
            Source: /home/hari/jekyll_workspace/gblog
       Destination: /home/hari/jekyll_workspace/gblog/_site
      Generating... done.
    Server address: http://0.0.0.0:4000
  Server running... press ctrl-c to stop.

Host your site / blog on the internet

Github pages support Jekyll websites, so it should be easy for us to now
publish the locally created blog site to github so the entire world can access your new site

Create a new project respository on github with following naming convention
USERNAME.github.com

where <USERNAME> is your github name.

BERIKAN KOMENTAR ()
Jangan Lupa Tinggalkan Komentarnya di Kolom komentar jika ada bug, atau artikelnya error atau tulisannya salah ya sahabat
 
wisata tradisi game kuliner
close