Install Jekyll and start blogging today

Blogging is fun right? But when it comes to “Jekyll”, I’ve found no other so easy to use and well integrated solution out there! You might say what about “Wordpress” or “Joomla”? I actually don’t like much those WYSIWYG editors as they make it really hard to see what HTML is being generated.To get/read further you must have knowledges on html, css, some JavaScript, jQuery and knowledges of using the Command Line Interface.

#####So what is “Jekyll” and why use “Jekyll”?

“Jekyll” is a static site generator, it transforms your plain texts into static sites and blogs. Jekyll is Not Blogging Software. Jekyll is a parsing engine. There is no database to inject and no CMS, there’s only files. It is written in “Ruby” programming language and uses “RubyGems” package manager.

Jekyll

There’s a hand full of static site generator out there. But “Jekyll” is most popular of them. It’s so easy to integrate that you don’t need any separate hosting, you can use github pages to deploy your site! “Jekyll” is well documented, you can find full documentation on jekyllrb.com website.

So, enough introduction, let us continue to the main article.

#####Installing Jekyll

For installing Jekyll we need to Install ruby, the ruby development libraries, the make command and also the nodeJs. (Installation of nodeJs is required because of an issue where Jekyll requires a JavaScript runtime even if it will not be used).

On Mac OS X or Linux (Ubuntu):

Open up the Terminal/CLI and paste the following commands:

  sudo apt-get install -y ruby
  sudo apt-get install -y ruby-dev
  sudo apt-get install -y make
  sudo apt-get install -y gcc
  sudo apt-get install -y nodejs  

Now, we will install “Jekyll” system wide and for speeding up things we will exclude the extended documentation. If you want to install the documentation you can just omit --no-rdoc --no-ri.

  sudo gem install jekyll -v 2.5.3 --no-rdoc --no-ri  

 

On Windows:

As said on Jekyllrb website, windows is not an officially-supported platform, but it can be used to run Jekyll with the proper tweaks. I’m going to cover “Julian Thilo’s” instruction here.

First of all you need to download the ruby installer from here: Ruby Installer

Execute the installer and go through the steps. When you get to the screen below, make sure to check the “Add Ruby executables to your PATH” box.

ruby-path

Click Install and Ruby will be installed within seconds.

Second download the ruby development kit. From here download Ruby DevKit.

The download is a self-extracting archive. When you execute the file, it’ll ask you for a destination for the files. Enter a path that has no spaces in it. We recommend something simple, like C:\RubyDevKit\. Click Extract and wait until the process is finished.

Next, you need to initialize the DevKit and bind it to your Ruby installation. Open your favorite command line tool and navigate to the folder you extracted the DevKit into.

  cd C:\RubyDevKit  

Auto-detect Ruby installations and add them to a configuration file for the next step.

  ruby dk.rb init  

Install the DevKit, binding it to your Ruby installation.

  ruby dk.rb install  

That’s it! Now just run the command to install “Jekyll”.

  gem install jekyll --no-rdoc --no-ri  

Again, if you want to install the documentation you can just omit --no-rdoc --no-ri.

BTW, there’s a Portable Jekyll for Windows, you can find the git repo and instructions here: github.com/madhur/PortableJekyll.

#####Test Jekyll

Check if Jekyll is successfully installed on your system. Run the following command on your “CLI”

  jekyll -v  

At the time of writing this blog v2.5.3 is the latest version.

If you want to use Github Pages with jekyll you can install the feature with gem, it bundles several gems supported by Github Pages.

  sudo gem install github-pages --no-rdoc --no-ri  

In addition git is also required for managing files of a “Jekyll” website.

  sudo apt-get install git  

On Windows you can install Git-Scm for windows from here.

#####Create New Site

or a new Jekyll site, use the new command to create a directory structure and config files.

  mkdir my-jekyll-blog
  jekyll new my-jekyll-blog
  cd my-jekyll-blog

#####Start Jekyll If you visit my-jekyll-blog directory you will see some files and directories have been auto generated and structured as follows.

my-jekyll-blog
  ├── about.md
  ├── _config.yml
  ├── css
  │   └── main.scss
  ├── feed.xml
  ├── _includes
  │   ├── footer.html
  │   ├── header.html
  │   └── head.html
  ├── index.html
  ├── _layouts
  │   ├── default.html
  │   ├── page.html
  │   └── post.html
  ├── _posts
  │   └── 2015-07-23-welcome-to-jekyll.markdown
  └── _sass
      ├── _base.scss
      ├── _layout.scss
      └── _syntax-highlighting.scss

Now you can run this command to generate the “Jekyll” website HTML and start a local server.

  jekyll serve

It will start Ruby Default Webrick Web Server. By default the port is 4000.

So, on your browser if you visit http://127.0.0.1:4000 you will see The “Jekyll’s” default home page.

Jekyll is now successfully running!

 

#####Reference

http://jekyllrb.com/docs/home/