Tuesday, October 17, 2017

How To Write Online Using Jekyll

Having a blog most often means you’re going to be dealing with a content management system like Wordpress.

While powerful, Wordpress has some familiar drawbacks. For one, backing up Wordpress is a pain and the security updates are almost constant. The WSYWIG editors also make it difficult to see what HTML is being produced and you can end up with inflated, unnecessary code. Plus, what happens if you don’t need a full-blown CMS?

This is where Jekyll comes in.

Jekyll describes itself as a “simple, blog-aware, static site generator”. What that means is that Jekyll allows you to transform your plain text into a blog or a static website by taking a template directory with raw text files and running it through a converter, which then produces a ready-to-publish blog or static website page that will work with whatever web server you choose. “Blog-aware” really just means that it can be used to create a blog, of any other kind of website that follows a series of posted entries.

While there are a couple methods to getting going with Jekyll, forking a starting point is the easiest way to get you up and running in just a few minutes. Forking a repository that follows best practices allows you to skip reading a ton of documentation. The options are pretty endless, but "Jekyll Now" and "poole" both give solid results.

What starting with the fork will allow you to do is get a feel for Jekyll without setting up a local dev environment, install dependencies and work out the build process. Instead, let GitHub pages build the website for you until you need to build it locally.

As a GitHub user, you’re entitled to one free “user” website. This website will live at http://yourusername.github.io, which is a perfect place for your Jekyll blog. GitHub will also provide free hosting for Jekyll blogs, which can save you $50+ a year. A nice bonus, if we’ve ever heard of one.

By placing your unbuilt Jekyll on the master branch of your user repository,
GitHub will automatically build the static website and serve it, without you having to worry about the build process.

Once this happens, click on the “settings” button in your brand new, forked repository, and replace yourusername with your GitHub name. From here, the website will go live immediately.

That fast? Yep.

From here, the customization begins. You can change the site’s name, description and more by editing the "_config.yml" file. These are custom variables that are there for your convenience and get pulled into the theme when your site is built. Making any changes to your "_config.yml" file will make GitHub Pages rebuild your site with Jekyll.

You can alter the site’s files in 3 ways:

Continue reading on Linkedin.

No comments:

Post a Comment