jekyll-index-pages 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4702f271a48980ae4127130e9523dcfd24d4b9f5
4
- data.tar.gz: ac8a99a5ccd5e235860ebfb181f7c8f11f3934a4
3
+ metadata.gz: 468dc3fd5880cc0e2df44a2eedcfbe609279459f
4
+ data.tar.gz: 37ae520dba6ed34d9db096c4a7fe4d17b5dee9e5
5
5
  SHA512:
6
- metadata.gz: f66dce91c5869abb04ca3508f55cb5898d80d9cf8a46ae58c583068422c171f84509cc7a8da0e431f83ba847145bd1bc8f393cdcfc4f02a1a4f7247e3becba81
7
- data.tar.gz: 03af6fb70329c30b449c8f686694436785e6ce62ecf194eb18816c0bec24ffee452c0566c03a36f5cd03ec7820a0a991f6b1bc3a6d0303c993c97e93ca749a85
6
+ metadata.gz: 951087de7210ad05e778ee62c14a2810c58c182f5c37e07003c8da94b6932c4694a9dd07481a3f11f36a80638374f2bf42e118a45835eaae22d3acb8898b82bf
7
+ data.tar.gz: ee5905ed2b38c7d89e63316a77d1e7fcffc66b74b0050a3c0fc393600df8153488e650aed00801b4e826b2c89e8e3ae29a54ba82a044f50ae68fece8098cb171
data/README.md CHANGED
@@ -108,7 +108,7 @@ layout: posts|categories|tags|authors|archive
108
108
  ```
109
109
 
110
110
  For categories and tags, `:label` variable refers to the category or tag name.
111
- For posts, `:label` will always be equal to `post`. For the archive, `:label`
111
+ For posts, `:label` will always be equal to `posts`. For the archive, `:label`
112
112
  refers to any given year. For authors, `:label` is the author name. `:label`
113
113
  value is slugified when composing the permalink.
114
114
 
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
22
  spec.require_paths = ["lib"]
23
23
 
24
+ spec.add_dependency("i18n", "~> 0.8")
24
25
  spec.add_dependency("jekyll", "~> 3.3")
25
26
 
26
27
  spec.add_development_dependency("bundler", "~> 1.14")
@@ -1,3 +1,4 @@
1
+ require "i18n"
1
2
  require "jekyll"
2
3
  require "jekyll-index-pages/archive"
3
4
  require "jekyll-index-pages/author"
@@ -7,4 +8,6 @@ require "jekyll-index-pages/generator"
7
8
  module JekyllIndexPages
8
9
  autoload :Pagination, "jekyll-index-pages/pagination"
9
10
  autoload :IndexPage, "jekyll-index-pages/index-page"
11
+
12
+ I18n.available_locales = [:en]
10
13
  end
@@ -36,9 +36,10 @@ module JekyllIndexPages
36
36
 
37
37
  pager = pagination.pager
38
38
 
39
+ label_slug = I18n.transliterate(Jekyll::Utils.slugify(label))
39
40
  dir =
40
41
  File.join(
41
- permalink.sub(":label", Jekyll::Utils.slugify(label)),
42
+ permalink.sub(":label", label_slug),
42
43
  (pager.current_page > 1) ? pager.current_page.to_s : ""
43
44
  )
44
45
 
@@ -1,3 +1,3 @@
1
1
  module JekyllIndexPages
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/spec/archive_spec.rb CHANGED
@@ -36,12 +36,12 @@ describe(JekyllIndexPages::Archive) do
36
36
  expect(site.data["archive"].length).to eq(5)
37
37
  end
38
38
 
39
- it("each year containing only one post") do
40
- expect(site.data["archive"]["1966"].length).to eq(1)
41
- expect(site.data["archive"]["1987"].length).to eq(1)
42
- expect(site.data["archive"]["1993"].length).to eq(1)
43
- expect(site.data["archive"]["1995"].length).to eq(1)
44
- expect(site.data["archive"]["2001"].length).to eq(1)
39
+ it("generates a post listing page per year") do
40
+ expect(site.data["archive"]["1966"].length).to be > 0
41
+ expect(site.data["archive"]["1987"].length).to be > 0
42
+ expect(site.data["archive"]["1993"].length).to be > 0
43
+ expect(site.data["archive"]["1995"].length).to be > 0
44
+ expect(site.data["archive"]["2001"].length).to be > 0
45
45
  end
46
46
  end
47
47
  end
data/spec/author_spec.rb CHANGED
@@ -36,12 +36,12 @@ describe(JekyllIndexPages::Author) do
36
36
  expect(site.data["authors"].length).to eq(5)
37
37
  end
38
38
 
39
- it("each page containing only one post") do
40
- expect(site.data["authors"]["James T Kirk"].length).to eq(1)
41
- expect(site.data["authors"]["Jean-Luc Picard"].length).to eq(1)
42
- expect(site.data["authors"]["Benjamin Sisko"].length).to eq(1)
43
- expect(site.data["authors"]["Kathryn Janeway"].length).to eq(1)
44
- expect(site.data["authors"]["Jonathan Archer"].length).to eq(1)
39
+ it("generates a post listing page per author") do
40
+ expect(site.data["authors"]["James T Kirk"].length).to be > 0
41
+ expect(site.data["authors"]["Jean-Luc Picard"].length).to be > 0
42
+ expect(site.data["authors"]["Benjamin Sisko"].length).to be > 0
43
+ expect(site.data["authors"]["Kathryn Janeway"].length).to be > 0
44
+ expect(site.data["authors"]["Jonathan Archer"].length).to be > 0
45
45
  end
46
46
  end
47
47
  end
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: "Viaje a las Estrellas: La Serie Original"
3
+ category: Ciencia ficción
4
+ tags: viaje-a-las-estrellas
5
+ author: James T Kirk
6
+ ---
7
+
8
+ # Viaje a las Estrellas: La Serie Original
@@ -45,8 +45,8 @@ describe(JekyllIndexPages::Generator) do
45
45
  expect(site.pages[0].url).to eq("/posts/")
46
46
  end
47
47
 
48
- it("generates a post index page with five documents") do
49
- expect(site.pages[0].data["pager"]["docs"].length).to eq(5)
48
+ it("generates a post index page with six documents") do
49
+ expect(site.pages[0].data["pager"]["docs"].length).to eq(6)
50
50
  end
51
51
 
52
52
  it("generates a post index page with recent documents first") do
@@ -173,13 +173,17 @@ describe(JekyllIndexPages::Generator) do
173
173
  end
174
174
 
175
175
  describe("Generator.generate") do
176
- it("generates a single category index page") do
177
- expect(site.pages.length).to eq(1)
176
+ it("generates two category index pages") do
177
+ expect(site.pages.length).to eq(2)
178
178
  end
179
179
 
180
180
  it("generates a category index page at /science-fiction/") do
181
181
  expect(site.pages[0].url).to eq("/science-fiction/")
182
182
  end
183
+
184
+ it("generates a category index page at /ciencia-ficcion/") do
185
+ expect(site.pages[1].url).to eq("/ciencia-ficcion/")
186
+ end
183
187
  end
184
188
  end
185
189
 
@@ -193,8 +197,8 @@ describe(JekyllIndexPages::Generator) do
193
197
  end
194
198
 
195
199
  describe("Generator.generate") do
196
- it("generates a single tag index page") do
197
- expect(site.pages.length).to eq(1)
200
+ it("generates two tag index pages") do
201
+ expect(site.pages.length).to eq(2)
198
202
  end
199
203
 
200
204
  it("generates a tag index page at /star-trek/") do
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-index-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Miguel Venegas Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: i18n
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.8'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: jekyll
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +120,7 @@ files:
106
120
  - spec/fixtures/index-page/_layouts/posts.html
107
121
  - spec/fixtures/index-page/_layouts/tags.html
108
122
  - spec/fixtures/index-page/_posts/1966-09-08-star-trek-the-original-series.md
123
+ - spec/fixtures/index-page/_posts/1966-09-08-viaje-a-las-estrellas-la-serie-original.md
109
124
  - spec/fixtures/index-page/_posts/1987-09-28-star-trek-the-next-generation.md
110
125
  - spec/fixtures/index-page/_posts/1993-01-03-star-trek-deep-space-nine.md
111
126
  - spec/fixtures/index-page/_posts/1995-01-16-star-trek-voyager.md
@@ -155,6 +170,7 @@ test_files:
155
170
  - spec/fixtures/index-page/_layouts/posts.html
156
171
  - spec/fixtures/index-page/_layouts/tags.html
157
172
  - spec/fixtures/index-page/_posts/1966-09-08-star-trek-the-original-series.md
173
+ - spec/fixtures/index-page/_posts/1966-09-08-viaje-a-las-estrellas-la-serie-original.md
158
174
  - spec/fixtures/index-page/_posts/1987-09-28-star-trek-the-next-generation.md
159
175
  - spec/fixtures/index-page/_posts/1993-01-03-star-trek-deep-space-nine.md
160
176
  - spec/fixtures/index-page/_posts/1995-01-16-star-trek-voyager.md