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 +4 -4
- data/lib/jekyll-urls/version.rb +1 -1
- data/lib/jekyll/generators/urls.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edab3bbd6df8ad1da9b24ae86149dfde2c1f2419
|
4
|
+
data.tar.gz: 4e18e0e67e75e5adc160324fc2a207e7f9446257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b71c7e2cfc9c04053056ce6ef68f96133d3dffad38c52313447a598b985b9fb35da72f3e39639c1a667684e87512a348402a86bfa487082834700bc94e44055
|
7
|
+
data.tar.gz: 2f4d580862d077cce1150af6a8664ac4503f760e5c0a1e96d41a97a80cd1a16a52a936e3e1a86b4566a8c1dc4b4619671279faefb60ecedcc6504aec94a65502
|
data/lib/jekyll-urls/version.rb
CHANGED
@@ -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
|
-
|
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
|