jekyll-urls 1.3.0 → 1.5.0

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: 9d625b0bc6493f4484374f7efc353a61cdd258e1
4
- data.tar.gz: 5d67b2fd022a742c91d5e48363b9bf82aaa0ba2c
3
+ metadata.gz: edab3bbd6df8ad1da9b24ae86149dfde2c1f2419
4
+ data.tar.gz: 4e18e0e67e75e5adc160324fc2a207e7f9446257
5
5
  SHA512:
6
- metadata.gz: c7d0ec917257b0165f3ed6d48714ec27d52bd912def0169fd6baebf45aff49feaad40c0beef4954ca685f3514b2442afb6bf7a885de12ecbb63083c5e4a8fc42
7
- data.tar.gz: 17d8a00da0063f92968e64c8db1c3ccb682f0664447c6ac0fdb1adca9deb3df3be7d778e5eed84136566e044c90c8789bd97cc0575d09fbd4e914b12dd6ff8bf
6
+ metadata.gz: 8b71c7e2cfc9c04053056ce6ef68f96133d3dffad38c52313447a598b985b9fb35da72f3e39639c1a667684e87512a348402a86bfa487082834700bc94e44055
7
+ data.tar.gz: 2f4d580862d077cce1150af6a8664ac4503f760e5c0a1e96d41a97a80cd1a16a52a936e3e1a86b4566a8c1dc4b4619671279faefb60ecedcc6504aec94a65502
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Urls
3
- VERSION = "1.3.0"
3
+ VERSION = "1.5.0"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@ module Jekyll
2
2
  module Converters
3
3
  class UrlsGenerator < Generator
4
4
  def generate(site)
5
+ ignore = '/index.html'
5
6
  lazy = lambda { |h,k| h[k] = Hash.new(&lazy) }
6
7
 
7
8
  def deep_set(hash, value, *keys)
@@ -13,8 +14,12 @@ module Jekyll
13
14
  site.config['urls'] = Hash.new(&lazy)
14
15
  site.pages.each { |page|
15
16
  if page.data['id']
16
- keys = page.data['id'].split(".")
17
- deep_set(site.config['urls'], page.url, *keys)
17
+ keys = page.data['id'].split('.')
18
+ page_url = page.url
19
+ if page_url.end_with? ignore
20
+ page_url = page_url[0, page_url.length - ignore.length + 1]
21
+ end
22
+ deep_set(site.config['urls'], page_url, *keys)
18
23
  end
19
24
  }
20
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-urls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkady Zalkowitsch