A minimal blog theme for Jekyll
by Georgi KalaydzhievI assume you have already downloaded and installed Ruby. Here's what you need to do next:
gem install jekyll bundler
.cd name-of-the-folder
.bundle install
.bundle exec jekyll serve
. This way it will be accessible on http://localhost:4000
._site
folder on your host server.All configuration options are in the _config.yml
file.
General Settings
http://mysite.com/blog/assets/images/avatar.jpg
. If you comment this row, "Steve" checks if you have an email and shows your gravatar if you have any.http://mysite.com/blog/assets/favicon.ico
.Important Note: Keep in mind that name, job_title, twitter_handler and some of the post specific variables are used as default meta data in some cases.
Social Accounts
Important: Do not change the names of the social networks!
Modules Settings
One thing to remember - 1 is on, 0 is off.
comments: true
in the post itself the comments will be visible. If it is off and you've added comments: true
in the post the comments will be hidden. This option is helpful if you want to turn on/off comments for all your posts at once.Defaults
true
.Serving
These options are pretty important, so take a closer look. If you experience any problems with your paths you should check them here.
https://mysite.com
htttp://mysite.com/blog
you should write down /blog
here.Includes
Outputting
http://mysite.com/categories/post-name.html
. If you want a different permalink check Jekyll documentation.categories
, so for example if you go to random category index you will see something like this http://mysite.com/categories/category-name/postname.html
.Pagination
/page:num/
, so for example if you go to second page you will see something like this http://mysite.com/page2/
.Important Note: Pagination is currently working only on home page due to Jekyll limitations.
Conversion
<!--more-->
to define excerpt. You have three options - to leave it as is, to change the tag or to completely remove it but in this case you'll always see the full content.Assets Settings
If you need extra help, just check out the official Jekyll documentation.
Additional Configuration
How to change your default theme color?
Just go to /assets/partials/_vars.scss
and change the color of the $primary-color
variable.
How Facebook knows which image to use for sharing?
By default the script gets the first image in the post so take that in mind when you write a blog post.
Adding Post
The next thing after you are done with the configuration file is to add your first post. You will need to have at least basic knowledge of HTML or Markdown.
All you need to do is to create a new file with name YYYY-MM-DD-my-first-post
and .markdown
or .md
extension. Create it in the _posts
folder. By default the name of the file is composed by date and title but you can overwrite these in the post's front matter.
In the beginning of the every post you have a so called front matter block which contains some data about the post. Here is the short description of the options.
layout: The post layout.
date: Exact date when the post is published. The date is actually pretty important and I suggest you never change it. Specific date helps Jekyll to order correctly all the posts. Also, the date is used to generate a unique ID, so Disqus can always get the right comments for the right post, even when you change the title.
title: Post's title.
description: Meta description used for better SEO.
comments: By default they are always true
, but if you want to turn them off for a specific post just set this to false
.
category: List the categories in which you want your post to appear.
tags: List your tags here.
Adding Page
Adding page is even simpler than adding post. Just create a sub-folder to the pages directory and inside that sub-folder create index.md file. The folder name is your page name. Every folder must contain index file. Pages are also using front matter to add information to your page.
layout: The page layout.
title: Page's title.
permalink: This is important. If you do not enter the permalink, your url will be something like this http://example.com/_pages/about
. Enter the permalink and get rid of /_pages/
part. Do not forget the trailing slash!
That's it! Do not hesitate to ask if you have any questions. Also you can send me feature requests. There are some nice features that are planed for the upcoming versions. Happy blogging!