Jekyll is a very simple static site generator which is natively supported by Github pages.
It’s very simple to set up and get your Jekyll blog running.
When I created this Jekyll blog using Github Pages, the post URLs were like:
And, it is very long and isn’t very good for SEO.
After messing up a bit, finally, I found a perfect solution to make post URLs SEO friendly.
- Open your blog folder and navigate to
permalink: /:title/in a new line anywhere in the
bundle exec jekyll serveand push the code to your server
Now, all your posts should be able to adapt the new SEO friendly Permalink Structure.
And, now, the new post URLs of my blog are like:
Recommended: Add your Jekyll blog to the Google Search Console
Adding images to your Jekyll blog
There are 2 ways to add images in the Jekyll Github Blog.
It’s preferable to create an
assets/img in the root directory of your Jekyll blog where you can put all the images and other assets.
Here’s how my Jekyll blog structure looks:
Also, it’s better to name your image files like
this-is-a-sample-image (with dashes) or
this_is_a_sample_image (with underscores).
Now, when creating
.md files, you can use the following ways:
Method #1 (preferable)
This is the best way to add images to your Jekyll blog, but you can go with the 2nd method below.
However, it’s not a good practice to use this method, but it works as well. Since
.md files get converted to static HTML pages, it works.