Building the blog
Hi there! I keep developing my personal Jekyll blog, and I would like to share with you these firsts steps. If you are new to Jekyll blogging, start reading part I.
Today I’m going to write about:
- Permalinks
- Domain
- Analytics
- Comments
Permalinks
With this blog system, post link format is centrally managed. Thus, you could deal with it later… if it wasn’t that when you change your linkage system you will broke the old links. That’s why they’re called permalinks (permanent links).
I’ve decided to keep my permalinks format as simple as possible
adding this to my _config.yml
file:
Date and categories have been removed in order to increase the readability of the urls (I can keep using date and categories for other purposes).
You can use the format that pleases you most (check the main options), so take your time to decide which is better for your needs, but remember to do it before start spreading links!
Domain
Domain is also a part of the permalink (an important one, actually), so it makes no sense to define the link format and start blogging with a provisional domain.
- Buy it at your favorite domain website.
- Define it as an alias for
yourusername.github.io
(usuallyCNAME record
, but every domain seller has its own configuration). - Create a file exactly named
CNAME
on your project root folder and writeyoudomain.com
inside it. - Push the changes to github.
Analytics
In order to track the usage information of my blog, I’ve added the Google Analytics system. It’s very easy to setup too.
- Just sign up into Google Analytics, create a new account (or a new project if you already have one) and get a piece of code like this:
-
Add it to
/_includes/google_analytics.html
. -
And finally, modify
/_layouts/default.html
:
After a while, it should start appearing data on your analytics dashboard.
Comments
And finally, the comments system. I’ve chosen Disqus because it’s highly used and very easy to integrate and manage, but you are free to use other services or even not to add comments at all.
If you choose this one, you can use this brief setup summary:
- Sign up at Disqus and create your site.
- Go to
Installation -> Universal Code
and copy the code to_includes/disqus.html
, replacing these lines:
with:
- Include the following code where you want to add the comments
(I’ve added it at the end of
_layouts/post.html
):
- And finally, add
on the posts or pages you want to make the comment system available. Set to false or don’t add it at all elsewhere.
And that’s it! More blog improvements coming soon…