The SEO on Octopress by default is moderate, but it can be better, too bad that the rake new_post
doesn’t generate Meta description and the keywords. The other problem is
redirect to single page which is broken since there is learnaholic.me and www.learnaholic.me
which can affect site ranking.
The third problem is that Octopress by default has a <domain>/blog
route path which is awkward
and unnecessary, domain is sufficient enough without /blog
.
The most SEO fixes are from the SEO for Octopress,Heroku post by Yatish Mehta.
Keywords and Description for every page
The provided keywords and description should be a goal for each page, the problem is
that rake new_post
doesn’t generate keywords and description, so it should be added
manually.
I’ve added the keywords and description to all my posts created in this few days and the post Octopress metadata looks like this:
1 2 3 4 5 6 7 8 9 |
|
Home page Keywords and Description
The Octopress by default shows latest post as home page, I choose not to go this way, my default home page is archive list. So there is no post from where it should include the keywords and description.
Setting Keywords and Description for Home page in _config.yml
Open the _config.yml
and add the kewords and description keys:
1 2 |
|
Change head.html template to be aware of Home page SEO
In .themes/classic/source/_includes/head.html
after meta tag for author
replace the
current description/keywords code with this one:
Single domain rewrite
To make sure that there is no differnce between learnaholic.me and www.learnaholic.me request, we shall include rewriting with gem rack-rewrite.
To Octopress Gemfile add:
1
|
|
To top of config.ru
(before SinatraStaticServer
) add:
1 2 3 4 5 6 7 8 9 10 |
|
Don’t forget to add a require on the top of the config.ru
:
1
|
|
Complete config.ru
should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
Set the route without unnecessary /blog route path
The Octopres by defult has a weird <domain>/blog/2012/10… route path, the blog
part of URL is totally unnecessary, so I removed it all together.
In _config.yml
change:
1 2 |
|
to:
1 2 |
|
Now the url should look like this:
http://learnaholic.me/2012/10/15/octopress-seo-and-disabling-the-blog-route/
But by default it would be:
http://learnaholic.me/blog/2012/10/15/octopress-seo-and-disabling-the-blog-route/
Conclusion
Improved SEO of the Octopress site:
- Including the keywords and description to each post.
- Home page is now with keywords and description, generic for the whole site.
- Redirect to single domain. The www.learnholic.me request will be redirected to learnaholic.me.
The cleaner site path by removing the unnecessary /blog
from the URL route.