middleman-generator-tag 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 424945de32b543333f0e9dd7f4b0f73c1f2d6718
4
- data.tar.gz: 9212fc5add4413be8092b314b66e91de9a5d8ef4
3
+ metadata.gz: 7efa53e012929944c742d587f29691c1c106b988
4
+ data.tar.gz: 026e90051d330f6ce8eb351fe44772a2cb36fd77
5
5
  SHA512:
6
- metadata.gz: 9fc63cff5c29546753fcf1c2e23f93eaab0c337e281e5c11334ca0a290c041419458fd3558f2da197e4c5f8193995b9c85bbbc19431b4f8c6acd84d0818fa871
7
- data.tar.gz: 60c5774ef17c92d3f06a2b96d33a14307beba92d607c923a11b3893b3bfc9a53caec178c2504a2969db6ae835ca0f4dd195a7b5a3a633ad0bc0149959baa5be2
6
+ metadata.gz: cae825e453bcc03ba5ea27ed8fb71ea96117d2de75f0a7c058fa89fe1b3c99c550f588b17c35437c979e9c2a63ca84e89b2cfd3541913a4bbaf68dc3a602b137
7
+ data.tar.gz: 9b44a29aa8cef1c7c795fa4caffb1d606deee611aac226602c8ff8a7faa68c6cc01d653836e18d0963ba7b404895c66f115a497b404b45804b4540f9c2374287
@@ -0,0 +1,16 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+ site_url = config[:sitemap_url] || "http://localhost:4567/"
5
+ xml.instruct!
6
+ xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do
7
+ sitemap.resources.select { |page| page.destination_path =~ /\.html/ }.each do |page|
8
+ xml.url do
9
+ xml.loc URI.escape(File.join(site_url, page.destination_path))
10
+ xml.lastmod Time.now.iso8601
11
+ xml.changefreq page.data.changefreq || "weekly"
12
+ xml.priority page.data.priority || "0.5"
13
+ end
14
+ end
15
+ end
16
+
@@ -5,14 +5,14 @@ module Middleman
5
5
  super
6
6
 
7
7
  extension = self
8
- app.after_render do |content, path, locs|
8
+ app.after_render do |content|
9
9
  if /<html>/ =~ content
10
10
  html = Nokogiri::HTML(content)
11
11
  if html.css("meta[name='generator']").length == 0
12
12
  content = extension.insert_tag(html)
13
13
  end
14
- content
15
14
  end
15
+ content
16
16
  end
17
17
  end
18
18
 
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module GeneratorTag
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-generator-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Terajima
@@ -113,6 +113,7 @@ files:
113
113
  - fixtures/empty-app/config.rb
114
114
  - fixtures/tag-app/config.rb
115
115
  - fixtures/tag-app/source/index.html.erb
116
+ - fixtures/tag-app/source/sitemap.xml.builder
116
117
  - lib/middleman-generator-tag.rb
117
118
  - lib/middleman-generator-tag/extension.rb
118
119
  - lib/middleman-generator-tag/version.rb