middleman-generator-tag 0.2.4 → 0.2.5

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: 260d9d69253df772a7cb1be8179212e7311a79a7
4
- data.tar.gz: 65bd83c57f916423ee4fa0b8dc70840ecd119aa7
3
+ metadata.gz: 1599451a326e1f37478242b3742e7c9aaa0c0736
4
+ data.tar.gz: f2b469354d1bdc83b95e64aa1cff90abb5a86689
5
5
  SHA512:
6
- metadata.gz: 4c73355d27a748872088d403bf7364e7e8aa846d231757d46b5a19fbd89c5bd2defae2848b6d97288b254946f5e70b28e39b8578b7157eeb1df2ed383c36f007
7
- data.tar.gz: e51f97159f8d5f044013076adeb0e1ecc32739d9ca95c68943fe8b5df7287bca4e12786f7ab552815f740a3767bedb842f9462556f3182c37839e5159b50142e
6
+ metadata.gz: 346827b3b84cc9f7275f5f2c5d5eb4cf6ff58f4375ccb3fa2fe496428ecdfa15db9809f147b59e24054e649d703cf1e3a2c86676fa0322ee19cea9d52b5b6357
7
+ data.tar.gz: 7d73bf691e36c0ba9aa22724fe863280f29a121dcc0804bf7be704b5401130b58e3b30e431dbb4a8f8c64dd41735e8942336ba0e96bf8b44c8a11704998928f4
data/.travis.yml CHANGED
@@ -3,9 +3,7 @@ sudo: false
3
3
  rvm:
4
4
  - ruby-head
5
5
  - 2.3.1
6
- - 2.2.4
7
- - 2.1
8
- - 2.0
6
+ - 2.2.5
9
7
  os:
10
8
  - linux
11
9
  matrix:
@@ -0,0 +1 @@
1
+ activate :generator_tag
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+ <!DOCTYPE html>
5
+ <html lang="ja">
6
+ <head>
7
+ <meta charset="utf-8">
8
+ <title>Title</title>
9
+ <meta name="keyword" content="something">
10
+ <meta name="description" content="something description">
11
+ </head>
12
+ <body>
13
+ </body>
14
+ </html>
@@ -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
+
@@ -6,9 +6,9 @@ module Middleman
6
6
 
7
7
  extension = self
8
8
  app.after_render do |content|
9
- if /<html>/ =~ content
9
+ if %r{</html>} =~ content
10
10
  html = Nokogiri::HTML(content)
11
- if html.css("meta[name='generator']").length == 0
11
+ if html.css("meta[name='generator']").length.zero?
12
12
  content = extension.insert_tag(html)
13
13
  end
14
14
  end
@@ -18,7 +18,7 @@ module Middleman
18
18
 
19
19
  def insert_tag(html)
20
20
  title = html.at_css('title')
21
- meta = Nokogiri::XML::Node.new "meta", html
21
+ meta = Nokogiri::XML::Node.new 'meta', html
22
22
  meta[:name] = 'generator'
23
23
  meta[:content] = "Middleman v#{::Middleman::VERSION}"
24
24
  title.add_next_sibling(meta)
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module GeneratorTag
3
- VERSION = "0.2.4"
3
+ VERSION = '0.2.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-generator-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Terajima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2016-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman
@@ -125,6 +125,9 @@ files:
125
125
  - bin/console
126
126
  - bin/setup
127
127
  - fixtures/empty-app/config.rb
128
+ - fixtures/lang-ja-app/config.rb
129
+ - fixtures/lang-ja-app/source/index.html.erb
130
+ - fixtures/lang-ja-app/source/sitemap.xml.builder
128
131
  - fixtures/tag-app/config.rb
129
132
  - fixtures/tag-app/source/index.html.erb
130
133
  - fixtures/tag-app/source/sitemap.xml.builder