From fed399f704035ed2a08214cfbcbbd0f48e81403e Mon Sep 17 00:00:00 2001 From: robbin Date: Thu, 28 Feb 2013 13:20:32 +0800 Subject: [PATCH] add pagination info to page title for SEO --- app/views/blog/index.erb | 2 ++ app/views/blog/note.erb | 1 + app/views/blog/tag.erb | 1 + app/views/home/index.erb | 1 + 4 files changed, 5 insertions(+) diff --git a/app/views/blog/index.erb b/app/views/blog/index.erb index 6183687..fddf3cb 100644 --- a/app/views/blog/index.erb +++ b/app/views/blog/index.erb @@ -1,5 +1,7 @@ <% @nav = 'blog' %> <% @title = "最近博客文章" %> +<% @title << " | 第#{params[:page]}页" if params[:page] && params[:page].to_i > 1 %> + <% @description = '最近发表的博客文章列表' %>
diff --git a/app/views/blog/note.erb b/app/views/blog/note.erb index f1cdc62..202d86b 100644 --- a/app/views/blog/note.erb +++ b/app/views/blog/note.erb @@ -1,5 +1,6 @@ <% @nav = 'note' %> <% @title = "最近更新笔记" %> +<% @title << " | 第#{params[:page]}页" if params[:page] && params[:page].to_i > 1 %> <% @description = '最近更新的笔记文章列表' %>
diff --git a/app/views/blog/tag.erb b/app/views/blog/tag.erb index 868a946..bac4f0c 100644 --- a/app/views/blog/tag.erb +++ b/app/views/blog/tag.erb @@ -1,5 +1,6 @@ <% @nav = 'tag' %> <% @title = params[:name].force_encoding("UTF-8") + "分类文章" %> +<% @title << " | 第#{params[:page]}页" if params[:page] && params[:page].to_i > 1 %> <% @description = params[:name].force_encoding("UTF-8") + "分类下所有文章列表" %>
diff --git a/app/views/home/index.erb b/app/views/home/index.erb index 9cff488..b83a594 100644 --- a/app/views/home/index.erb +++ b/app/views/home/index.erb @@ -1,4 +1,5 @@ <% @nav = 'home' %> +<% @title = "#{APP_CONFIG['site_title']} | 第#{params[:page]}页" if params[:page] && params[:page].to_i > 1 %>
<%= partial 'blog/blog', :collection => @blogs %>