How to use Jekyll like a pro : building contact forms

Jekyll is a static site generator that takes a bunch of html and markdown files and generates a static site ready for hosting for free with GitHub pages,GitLab or using your own server(Cheap cost).Jekyll is by far the most popular static site generator out there.

Jekyll is blog aware which means that things such as posts , categories , permalinks are first class citizens so you don’t need to worry if you are intending to build your blog with Jekyll,it should be easy and straightforward.

Jekyll is all about static files which means there is no database and no need for security patches ,your website is more secure and very fast(no time spent accessing database).

Unlike other blogging platforms Jekyll gives you a total control over your SEO.   If you are building a static website or a blog with Jekyll and you care about SEO ( You should ! ) in this post i’ll try to show you how to deal with some important SEO tricks when using Jekyll.

URL redirection

URL redirection means redirecting an old url to a new url so you can tell browsers and search engines that some resource has moved to a new location,this is just one of the reasons ,you can read this wikipedia article for other reasons why need URL redirection.

You can do url redirection using 301 redirect which means moved permanently to search engines but that’s only possible if you are in control of the web server ,in case of a Jekyll website hosted with GitHub or GitLab you need to implement client side redirection 

To implement client side redirection you can use the Meta refresh tag which redirects the visitor to a new location after some controlled amount of time has passed.


You can put the amount of time and the url to the new location in the content attribute separated by a semi-colon.

So how to do URL redirection the Jekyll way,you have two options either use a plugin or a layout.

Jekyll Redirect From Plugin

Allows you to do redirects and is white listed by GitHub so you can use it ith your GitHub pages ,This is a GEM package so all you have to do is installing it from your terminal and start using it by adding either redirectfrom or redirectto in YAML FrontMatter of a post or page that you want to redirect from or to.For more information on how to use this plugin head over to its GitHub repo(

If you are not fan of plugins you can use a layout that redirects you using the Mete refresh tag

  <!DOCTYPE html>
  <link rel="canonical" href=""/>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta http-equiv="refresh" content="0;url=" />
        <a href="">Click here if you are not redirected.<a>

Then you can add redirection from any post or page by extending the layout and specify the redirect_to parameter

  layout: redirected
  sitemap: false
  permalink: /oldlocation/
  redirect_to:  /newlocation/

You should put sitemap: false in the front matter so your redirected page won’t get included in your sitemap.

Link building ,use rel= nofollow with external links

If you include external links in your website then a good seo measure you should be aware of is to specify rel=”nofollow” which tells search engines not to follow these links which preserves your page rank from being transmitted to these urls websites it’s also used to preserve you website authority if the external links you are pointing to are more than the backlinks you have(urls pointing to you)

So how to add rel=”nofollow” automatically to your externa links 

You should install first Nokogiri a Ruby XML and HTML library gem install nokogiri

require 'nokogiri'

module Jekyll
  module ExtLinks
    # Access plugin config in _config.yml
    def config

    # Checks if str contains any fragment of the fragments array
    def contains_any(str, fragments)
      return false unless Regexp.union(fragments) =~ str

    def extlinks(content)
      # Process configured link attributes and whitelisted hosts
      if config
        if config['attributes']
          attributes = Array(config['attributes'])
        if config['rel_exclude']
          rel_exclude = Array(config['rel_exclude'])
      # Stop if no attributes were specified
      return content unless attributes

      doc = Nokogiri::HTML.parse(content)
      # Stop if we could't parse with HTML
      return content unless doc

      doc.css('a').each do |a|
        # If this is a local link don't change it
        next unless a.get_attribute('href') =~ /\Ahttp/i

        attributes.each do |attr, value|
          if attr.downcase == 'rel'
            # If there's a rel already don't change it
            next unless !a.get_attribute('rel') || a.get_attribute('rel').empty?
            # Skip whitelisted hosts for the 'rel' attribute
            next if rel_exclude && contains_any(a.get_attribute('href'), rel_exclude)
          a.set_attribute(attr, value)




Developed by Dmitry Ogarkov - #

To configure the plugin add this to your _config.yml

  # extlinks:
  #   attributes: {rel: nofollow, target: _blank}
  #   rel_exclude: ['', '']
  Now you can use it in the layout 
  <!DOCTYPE html>

Error:Buildtools 24.0.2 requires Java 1.8 or above. Current JDK version is 1.7 Under Ubuntu | Techiediaries

Error:Buildtools 24.0.2 requires Java 1.8 or above. Current JDK version is 1.7 Under Ubuntu

Rencently i've started working with Android Studio instead of Eclipse for developing Android applications.As usual,when starting with a new development tool ,the installation process takes time and causes a lot of frustration to most developers .Anyway to work with the latest Android Studio you need to have Java 1.8 installed in your computer as recommended by Google on its Android studio website,if you just go with any version of Java,you have already, and ignore that recommendation, all is going to be fine until you create your first project you'll be welcomed with this error:

<b>Error:Buildtools 24.0.2 requires Java 1.8 or above. Current JDK version is 1.7</b>

So if you are encoutering the same problem and you are using Ubuntu feel free to follow my post on how to solve the probem.

First of all i've installed the latest version of Java(1.8) using this PPA ppa:webupd8team/java.If you have a problem installing Java you can follow this detailed post on How to install Java 1.8 under Ubuntu 15

After installing Java 8 I started my Android Studio again and when i've executed my newely created project i encoutered the same problem again .So what the hell is going on ? don't worry I have the solution here .

Change your project settings to use Oracle Java 1.8 instead of Java 1.7

This is very simple just hit F4 or Right Click on your project and choose module settings from the menu

Now all you have to do is changing

comments powered by Disqus
  Subscribe to our newsletter or just close

Copyright © 2018 Techiediaries

<script type="text/javascript"
<noscript><div class="statcounter"><a title="real time web
analytics" href=""
target="_blank"><img class="statcounter"
src="//" alt="real
time web analytics"></a></div></noscript>
<!-- End of Statcounter Code -->

Cloacking external links

Masking external links by using internal links so instead of going to your visitor will visit first ,for example and then gets redirected to .So how we can achieve URL cloaking or masking using Jekyll.

comments powered by Disqus
  Subscribe to our newsletter or just close