jekyll-nested-menu-generator 0.0.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +5 -3
- data/CHANGELOG.md +8 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +57 -64
- data/README.md +44 -1
- data/jekyll-nested-menu-generator.gemspec +9 -7
- data/lib/jekyll-nested-menu-generator.rb +1 -1
- data/spec/nested_menu_spec.rb +9 -10
- data/spec/spec_helper.rb +1 -0
- metadata +16 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34d011aeb568724b664a2eb5fdde4670e6bc4e35
|
4
|
+
data.tar.gz: f8edba7bc3f3110344ec995be2171c36fcce5eb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869d4c639cb56a037f16983fd44f66068e84c214ab3a114a8383c1785b73540b0deadea5f92266e3f0a03ac43b78aa37234349970f0e0f20bff05d4e360e939d
|
7
|
+
data.tar.gz: fd38458b135512bcc51aed9d23bea309dffb351c1f2c1495b8400fa3ea3f0d00794344768390a53f2fe3f5fd7814a1c76017249b65e158c0bf19e7d31ee3d94a
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.idea
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.5
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in jekyll-
|
3
|
+
# Specify your gem's dependencies in jekyll-nested-menu-generator.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
group :test do
|
7
7
|
gem "fakefs", require: "fakefs/safe"
|
8
|
-
gem 'nokogiri'
|
8
|
+
gem 'nokogiri', '~>1.10.8'
|
9
9
|
gem 'pry'
|
10
10
|
gem 'rspec'
|
11
11
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,77 +1,68 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jekyll-nested-menu-generator (
|
5
|
-
jekyll
|
4
|
+
jekyll-nested-menu-generator (1.0.1)
|
5
|
+
jekyll (>= 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
timers (~> 4.0.0)
|
13
|
-
classifier-reborn (2.0.3)
|
14
|
-
fast-stemmer (~> 1.0)
|
10
|
+
addressable (2.7.0)
|
11
|
+
public_suffix (>= 2.0.2, < 5.0)
|
15
12
|
coderay (1.1.0)
|
16
|
-
|
17
|
-
|
18
|
-
execjs
|
19
|
-
coffee-script-source (1.9.0)
|
20
|
-
colorator (0.1)
|
13
|
+
colorator (1.1.0)
|
14
|
+
concurrent-ruby (1.1.7)
|
21
15
|
diff-lcs (1.2.5)
|
22
|
-
|
16
|
+
em-websocket (0.5.1)
|
17
|
+
eventmachine (>= 0.12.9)
|
18
|
+
http_parser.rb (~> 0.6.0)
|
19
|
+
eventmachine (1.2.7)
|
23
20
|
fakefs (0.6.5)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
ffi (1.13.1)
|
22
|
+
forwardable-extended (2.6.0)
|
23
|
+
http_parser.rb (0.6.0)
|
24
|
+
i18n (0.9.5)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
jekyll (3.9.0)
|
27
|
+
addressable (~> 2.4)
|
28
|
+
colorator (~> 1.0)
|
29
|
+
em-websocket (~> 0.5)
|
30
|
+
i18n (~> 0.7)
|
33
31
|
jekyll-sass-converter (~> 1.0)
|
34
|
-
jekyll-watch (~>
|
35
|
-
kramdown (
|
36
|
-
liquid (~>
|
32
|
+
jekyll-watch (~> 2.0)
|
33
|
+
kramdown (>= 1.17, < 3)
|
34
|
+
liquid (~> 4.0)
|
37
35
|
mercenary (~> 0.3.3)
|
38
|
-
|
39
|
-
|
36
|
+
pathutil (~> 0.9)
|
37
|
+
rouge (>= 1.7, < 4)
|
40
38
|
safe_yaml (~> 1.0)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
listen (2.8.5)
|
53
|
-
celluloid (>= 0.15.2)
|
54
|
-
rb-fsevent (>= 0.9.3)
|
55
|
-
rb-inotify (>= 0.9)
|
56
|
-
mercenary (0.3.5)
|
39
|
+
jekyll-sass-converter (1.5.2)
|
40
|
+
sass (~> 3.4)
|
41
|
+
jekyll-watch (2.2.1)
|
42
|
+
listen (~> 3.0)
|
43
|
+
kramdown (2.3.0)
|
44
|
+
rexml
|
45
|
+
liquid (4.0.3)
|
46
|
+
listen (3.2.1)
|
47
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
48
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
49
|
+
mercenary (0.3.6)
|
57
50
|
method_source (0.8.2)
|
58
|
-
|
59
|
-
nokogiri (1.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
posix-spawn (0.3.9)
|
51
|
+
mini_portile2 (2.4.0)
|
52
|
+
nokogiri (1.10.10)
|
53
|
+
mini_portile2 (~> 2.4.0)
|
54
|
+
pathutil (0.16.2)
|
55
|
+
forwardable-extended (~> 2.6)
|
64
56
|
pry (0.10.1)
|
65
57
|
coderay (~> 1.1.0)
|
66
58
|
method_source (~> 0.8.1)
|
67
59
|
slop (~> 3.4)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
redcarpet (3.2.2)
|
60
|
+
public_suffix (4.0.5)
|
61
|
+
rb-fsevent (0.10.4)
|
62
|
+
rb-inotify (0.10.1)
|
63
|
+
ffi (~> 1.0)
|
64
|
+
rexml (3.2.4)
|
65
|
+
rouge (3.22.0)
|
75
66
|
rspec (3.2.0)
|
76
67
|
rspec-core (~> 3.2.0)
|
77
68
|
rspec-expectations (~> 3.2.0)
|
@@ -85,14 +76,13 @@ GEM
|
|
85
76
|
diff-lcs (>= 1.2.0, < 2.0)
|
86
77
|
rspec-support (~> 3.2.0)
|
87
78
|
rspec-support (3.2.0)
|
88
|
-
safe_yaml (1.0.
|
89
|
-
sass (3.4
|
79
|
+
safe_yaml (1.0.5)
|
80
|
+
sass (3.7.4)
|
81
|
+
sass-listen (~> 4.0.0)
|
82
|
+
sass-listen (4.0.0)
|
83
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
84
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
90
85
|
slop (3.6.0)
|
91
|
-
timers (4.0.1)
|
92
|
-
hitimes
|
93
|
-
toml (0.1.2)
|
94
|
-
parslet (~> 1.5.0)
|
95
|
-
yajl-ruby (1.2.1)
|
96
86
|
|
97
87
|
PLATFORMS
|
98
88
|
ruby
|
@@ -100,6 +90,9 @@ PLATFORMS
|
|
100
90
|
DEPENDENCIES
|
101
91
|
fakefs
|
102
92
|
jekyll-nested-menu-generator!
|
103
|
-
nokogiri
|
93
|
+
nokogiri (~> 1.10.8)
|
104
94
|
pry
|
105
95
|
rspec
|
96
|
+
|
97
|
+
BUNDLED WITH
|
98
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Build Status](https://travis-ci.org/Granicus/jekyll-nested-menu-generator.svg?branch=master)](https://travis-ci.org/granicus/jekyll-nested-menu-generator)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/jekyll-nested-menu-generator.svg)](http://badge.fury.io/rb/jekyll-nested-menu-generator)
|
3
3
|
|
4
4
|
jekyll-nested-menu-generator
|
@@ -21,3 +21,46 @@ Or install it manually:
|
|
21
21
|
|
22
22
|
gem install jekyll-nested-menu-generator
|
23
23
|
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Say you have a number of pages, organized into folders, some of which are in
|
27
|
+
other folders. For example, let's consider a website about music, with pages
|
28
|
+
about albums organized into folders based on artists and year released:
|
29
|
+
|
30
|
+
```
|
31
|
+
/
|
32
|
+
|- Albums/
|
33
|
+
| |- 1994/
|
34
|
+
| | |- Oasis/
|
35
|
+
| | | |- Definitely_Maybe/
|
36
|
+
| | | | |- index.md
|
37
|
+
| | |- The Offspring/
|
38
|
+
| | | |- Smash/
|
39
|
+
| | | | |- index.md
|
40
|
+
| | |- index.md
|
41
|
+
| |- 1995/
|
42
|
+
| | |- Michael Jackson/
|
43
|
+
| | | |- HIStory_Past_Present_and_Future_Book_I/
|
44
|
+
| | | | |- index.md
|
45
|
+
| | |- Radiohead/
|
46
|
+
| | | |- The_Bends/
|
47
|
+
| | | | |- index.md
|
48
|
+
| | |- index.md
|
49
|
+
| |- 1996/
|
50
|
+
| | |- Jay Z/
|
51
|
+
| | | |- Reasonable_Doubt/
|
52
|
+
| | | | |- index.md
|
53
|
+
| | |- Weezer/
|
54
|
+
| | | |- Pinkerton/
|
55
|
+
| | | | |- index.md
|
56
|
+
| | |- index.md
|
57
|
+
|- index.html
|
58
|
+
```
|
59
|
+
|
60
|
+
Let's assume that on index.md you would like to include a nested menu of all of
|
61
|
+
the pages under Albums. To do this, simply use the 'nested_menu' liquid tag like
|
62
|
+
so:
|
63
|
+
|
64
|
+
```
|
65
|
+
{% nested_menu Albums %}
|
66
|
+
```
|
@@ -1,18 +1,20 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'jekyll-nested-menu-generator'
|
3
|
-
s.version = '
|
4
|
-
s.date = '
|
5
|
-
s.authors = ['
|
6
|
-
s.email = 'support@
|
7
|
-
s.homepage = 'https://github.com/
|
3
|
+
s.version = '1.0.1'
|
4
|
+
s.date = '2020-08-27'
|
5
|
+
s.authors = ['Granicus']
|
6
|
+
s.email = 'support@granicus.com'
|
7
|
+
s.homepage = 'https://github.com/granicus/jekyll-nested-menu-generator'
|
8
8
|
s.license = 'BSD-3-Clause'
|
9
9
|
s.summary = 'Tag for generating a nested navigation menu.'
|
10
10
|
s.description = %q{Provides a tag that generates a nested navigation menu for
|
11
|
-
a
|
11
|
+
a specified folder. Useful for automatically generating
|
12
12
|
a multilevel menu that mirrors your directory structure,
|
13
13
|
or generating a menu of generated pages.}
|
14
14
|
|
15
|
-
s.
|
15
|
+
s.required_ruby_version = '>= 2.3.0'
|
16
|
+
|
17
|
+
s.add_runtime_dependency 'jekyll', '>= 3.0'
|
16
18
|
|
17
19
|
s.files = `git ls-files`.split($\)
|
18
20
|
s.require_paths = ['lib']
|
@@ -48,7 +48,7 @@ module Jekyll
|
|
48
48
|
menu_hash.each do |dir_name, dir|
|
49
49
|
item_string_part = ''
|
50
50
|
|
51
|
-
#
|
51
|
+
# Separate the child pages from other descendent pages
|
52
52
|
if dir.is_a?(Jekyll::Page)
|
53
53
|
dir_hash = {}
|
54
54
|
dir_hash[dir.name] = dir
|
data/spec/nested_menu_spec.rb
CHANGED
@@ -18,8 +18,6 @@ describe 'nested_menu', fakefs:true do
|
|
18
18
|
@page = Page.new(@site, source_dir, dir, file)
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
21
|
let(:page) { '{% nested_menu files %}' }
|
24
22
|
|
25
23
|
before(:all) do
|
@@ -49,7 +47,7 @@ describe 'nested_menu', fakefs:true do
|
|
49
47
|
FakeFS.deactivate!
|
50
48
|
end
|
51
49
|
|
52
|
-
it 'Yields a nested menu of items in the
|
50
|
+
it 'Yields a nested menu of items in the specified folder' do
|
53
51
|
t = Liquid::Template.parse(page)
|
54
52
|
o = t.render!({'site' => {
|
55
53
|
'pages' => @site.pages,
|
@@ -57,14 +55,15 @@ describe 'nested_menu', fakefs:true do
|
|
57
55
|
}})
|
58
56
|
|
59
57
|
o_obj = Nokogiri::XML.parse(o)
|
58
|
+
|
60
59
|
expect(o_obj.xpath('/ul')).not_to be_empty
|
61
|
-
expect(o_obj.xpath('/ul/li[1]/a[.="Test!"][@href="/files/one/
|
62
|
-
expect(o_obj.xpath('/ul/li[2]/a[.="Test!"][@href="/files/two/
|
63
|
-
expect(o_obj.xpath('/ul/li[3]/a[.="Test!"][@href="/files/three/
|
64
|
-
expect(o_obj.xpath('/ul/li[1]/ul/li[1]/a[.="Test!"][@href="/files/one/a/
|
65
|
-
expect(o_obj.xpath('/ul/li[1]/ul/li[2]/a[.="Test!"][@href="/files/one/b/
|
66
|
-
expect(o_obj.xpath('//a[@href="/content/
|
67
|
-
expect(o_obj.xpath('//a[@href="/images/
|
60
|
+
expect(o_obj.xpath('/ul/li[1]/a[.="Test!"][@href="/files/one/"]')).not_to be_empty
|
61
|
+
expect(o_obj.xpath('/ul/li[2]/a[.="Test!"][@href="/files/two/"]')).not_to be_empty
|
62
|
+
expect(o_obj.xpath('/ul/li[3]/a[.="Test!"][@href="/files/three/"]')).not_to be_empty
|
63
|
+
expect(o_obj.xpath('/ul/li[1]/ul/li[1]/a[.="Test!"][@href="/files/one/a/"]')).not_to be_empty
|
64
|
+
expect(o_obj.xpath('/ul/li[1]/ul/li[2]/a[.="Test!"][@href="/files/one/b/"]')).not_to be_empty
|
65
|
+
expect(o_obj.xpath('//a[@href="/content/"]')).to be_empty
|
66
|
+
expect(o_obj.xpath('//a[@href="/images/"]')).to be_empty
|
68
67
|
|
69
68
|
end
|
70
69
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-nested-menu-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Granicus
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,26 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '3.0'
|
27
27
|
description: |-
|
28
28
|
Provides a tag that generates a nested navigation menu for
|
29
|
-
a
|
29
|
+
a specified folder. Useful for automatically generating
|
30
30
|
a multilevel menu that mirrors your directory structure,
|
31
31
|
or generating a menu of generated pages.
|
32
|
-
email: support@
|
32
|
+
email: support@granicus.com
|
33
33
|
executables: []
|
34
34
|
extensions: []
|
35
35
|
extra_rdoc_files: []
|
36
36
|
files:
|
37
|
+
- ".gitignore"
|
37
38
|
- ".ruby-version"
|
38
39
|
- ".travis.yml"
|
40
|
+
- CHANGELOG.md
|
39
41
|
- Gemfile
|
40
42
|
- Gemfile.lock
|
41
43
|
- LICENSE.md
|
@@ -44,11 +46,11 @@ files:
|
|
44
46
|
- lib/jekyll-nested-menu-generator.rb
|
45
47
|
- spec/nested_menu_spec.rb
|
46
48
|
- spec/spec_helper.rb
|
47
|
-
homepage: https://github.com/
|
49
|
+
homepage: https://github.com/granicus/jekyll-nested-menu-generator
|
48
50
|
licenses:
|
49
51
|
- BSD-3-Clause
|
50
52
|
metadata: {}
|
51
|
-
post_install_message:
|
53
|
+
post_install_message:
|
52
54
|
rdoc_options: []
|
53
55
|
require_paths:
|
54
56
|
- lib
|
@@ -56,16 +58,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
58
|
requirements:
|
57
59
|
- - ">="
|
58
60
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
61
|
+
version: 2.3.0
|
60
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
63
|
requirements:
|
62
64
|
- - ">="
|
63
65
|
- !ruby/object:Gem::Version
|
64
66
|
version: '0'
|
65
67
|
requirements: []
|
66
|
-
rubyforge_project:
|
67
|
-
rubygems_version: 2.
|
68
|
-
signing_key:
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.5.2.1
|
70
|
+
signing_key:
|
69
71
|
specification_version: 4
|
70
72
|
summary: Tag for generating a nested navigation menu.
|
71
73
|
test_files: []
|