Octopress is a very cool blog system, you can generae posts by jeklly.
And push your site to github.
Since I found my blog get a pr 2, I always think how to SEO my blog. And thkans to Google, I found some tools.
Add Original Link after the Post
Mr Sunshine write an article about how to add space between Chinese Word and English Word. Inspired by this, Kevin write a ruby plugin to add the original link after the octopress post. It is awesome.
And Tiny change the plugin to add the keyword after the octopress post also. So I just read the source code and add edit it for myself.
These are the source code for octopress-add-original-link.rb
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 38 39 40 |
|
The file is here—octopress-add-original-link.rb please use the below link to download the newer one
And the newer version that fix a bug is in add-original-link version2
And after I modified, It is only can show the post’s original link.
Before you use it, you need to edit your _config.yml
, and add these.
original_url_pre: "The Original Link: "
license_url: /license
license_name: "CC BY-NC-SA 4.0"
The contents after :
, you need edit them by yourself for your site.
Add Keywords and Description for the Post and the Page
It will look like this:
And what you need to do is just add post.puts "keywords: "
post.puts "description: "
in your Rakefile
Like this
puts "Creating new post: #{filename}"
open(filename, 'w') do |post|
post.puts "---"
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/&/,'&')}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
post.puts "comments: true"
post.puts "categories: "
post.puts "keywords: "
post.puts "description: "
post.puts "---"
Maybe you will need CTRL+F
to find the post.puts
And it is the same as adding the keywords and description to the page
in octopress.
Add the Keywords And Description to The Whole Octopress Site
It is more easy, just add
description: "Description for the website"
keywords: "keywords, for, the, website"
in your octopress’s _config.yml
file, and modify the source/_includes/head.html
after the author meta like this:
1 2 3 4 |
|
After the modifying, when you check the keywords
and Description
, they will show what you add in _config.yml
The above code was optimizated by myself, this is the new version with optimization about site’s description and keywords .
Add description and keywords version3
I think you will like it, my octopressers.
Reference Articles:
The Original Link: http://baham.github.io/04_29_octopress-seo.html
If you want to reprint it, please do under the CC BY-NC-SA 4.0