Skip to content

Commit

Permalink
add sitemap.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
wongyouth committed Apr 25, 2014
1 parent 2ab1225 commit 52a5d89
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -7,6 +7,7 @@ gem "middleman-blog", "~> 3.5.2"
gem "middleman-livereload", '~>3.3.2'
gem 'middleman-syntax'
gem 'middleman-deploy'
gem 'middleman-search_engine_sitemap'

# For feed.xml.builder
gem "builder", "~> 3.0"
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -87,6 +87,9 @@ GEM
em-websocket (~> 0.5.0)
middleman-core (~> 3.2)
rack-livereload (~> 0.3.15)
middleman-search_engine_sitemap (1.0.1)
builder
middleman-core (~> 3.2)
middleman-sprockets (3.3.2)
middleman-core (>= 3.2)
sprockets (~> 2.2)
Expand Down Expand Up @@ -163,6 +166,7 @@ DEPENDENCIES
middleman-blog (~> 3.5.2)
middleman-deploy
middleman-livereload (~> 3.3.2)
middleman-search_engine_sitemap
middleman-syntax
nokogiri
pry
Expand Down
3 changes: 3 additions & 0 deletions config.rb
Expand Up @@ -158,3 +158,6 @@ def page_title
end
end

# site map
set :url_root, data.site.url
activate :search_engine_sitemap
1 change: 1 addition & 0 deletions source/blog.html.erb
Expand Up @@ -3,6 +3,7 @@ title: 文章
pageable: true
per_page: 10
layout: blog
change_frequency: daily
---

<% page_articles.each_with_index do |article, i| %>
Expand Down
1 change: 1 addition & 0 deletions source/blog/archives.html.slim
@@ -1,6 +1,7 @@
---
title: 归档
layout: blog
change_frequency: daily
---

- blog.articles.group_by{|p| p.date.year}.each do |year, articles|
Expand Down
4 changes: 4 additions & 0 deletions source/calendar.html.erb
@@ -1,3 +1,7 @@
---
change_frequency: daily
---

<%
title = case page_type
when 'day'
Expand Down
1 change: 1 addition & 0 deletions source/index.html.erb
Expand Up @@ -2,6 +2,7 @@
pageable: true
per_page: 10
layout: blog
change_frequency: daily
---

<% page_articles.each_with_index do |article, i| %>
Expand Down
1 change: 1 addition & 0 deletions source/layouts/layout.html.erb
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" content="<%= data.site.keywords %>">
<meta name="description" content="<%= data.site.description %>">
<title><%= data.site.name %><%= page_title %></title>
<%= feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" %>
Expand Down
1 change: 1 addition & 0 deletions source/tag.html.erb
Expand Up @@ -3,6 +3,7 @@ title: 标签
pageable: true
per_page: 12
layout: blog
change_frequency: daily
---
<h1>含有 <code><%= tagname %></code> 标签的博文</h1>

Expand Down

0 comments on commit 52a5d89

Please sign in to comment.