jekyll-attendease 0.6.25d → 0.6.25e
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 +4 -4
- data/lib/jekyll/attendease_plugin/schedule_data_parser.rb +5 -5
- data/lib/jekyll/attendease_plugin/site_page_blocks_json.rb +1 -1
- data/lib/jekyll/attendease_plugin/site_pages_generator.rb +21 -19
- data/lib/jekyll/attendease_plugin/sponsor_generator.rb +1 -2
- data/lib/jekyll/attendease_plugin/version.rb +1 -1
- data/spec/lib/jekyll/attendease_plugin/event_data_generator_spec.rb +18 -13
- data/spec/lib/jekyll/attendease_plugin/event_layout_generator_spec.rb +1 -1
- data/spec/lib/jekyll/attendease_plugin/schedule_generator_spec.rb +32 -32
- data/spec/lib/jekyll/attendease_plugin/site_page_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -3
- 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: 29fc7316fdea55a13715da1405c0fa533a0c338a
|
4
|
+
data.tar.gz: 5c1123aee2a2ec7c18c0f49536fe304df1c33cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c3c70100643723ffbc86968bb7fd3c35a41a6ad0b241327b341857e779881ca3728979824f71449acfd0b6e6a2e9f3626c5f2e3ccf59bed6d5615e5b884343
|
7
|
+
data.tar.gz: e41413d559fe17acbb88e877c7929b5e2298867c2ebe0e119fe51f3912f0d8c806bf06be5a00290a5bd3fa9b87ddc744206b9683f3b93934038325f1840264ee
|
@@ -59,23 +59,23 @@ module Jekyll
|
|
59
59
|
protected
|
60
60
|
|
61
61
|
def raw_presenters
|
62
|
-
@raw_presenters ||= @site.
|
62
|
+
@raw_presenters ||= @site.data['presenters'].sort{|p1, p2| p1['last_name'] <=> p2['last_name']}
|
63
63
|
end
|
64
64
|
|
65
65
|
def raw_venues
|
66
|
-
@raw_venues ||= @site.
|
66
|
+
@raw_venues ||= @site.data['venues'].sort{|v1, v2| v1['name'] <=> v2['name']}
|
67
67
|
end
|
68
68
|
|
69
69
|
def raw_rooms
|
70
|
-
@raw_rooms ||= @site.
|
70
|
+
@raw_rooms ||= @site.data['rooms'].sort{|r1, r2| r1['name'] <=> r2['name']}
|
71
71
|
end
|
72
72
|
|
73
73
|
def raw_sessions
|
74
|
-
@raw_sessions ||= @site.
|
74
|
+
@raw_sessions ||= @site.data['sessions'].sort{|s1, s2| s1['name'] <=> s2['name']}
|
75
75
|
end
|
76
76
|
|
77
77
|
def raw_filters
|
78
|
-
@raw_filters ||= @site.
|
78
|
+
@raw_filters ||= @site.data['filters'].sort{|f1, f2| f1['name'] <=> f2['name']}
|
79
79
|
end
|
80
80
|
|
81
81
|
def data_path
|
@@ -27,7 +27,7 @@ module Jekyll
|
|
27
27
|
|
28
28
|
# sort each bucket by widget weight
|
29
29
|
zones.each do |k, zone|
|
30
|
-
zone.sort! { |x, y|
|
30
|
+
zone.sort! { |x, y| x['weight'] <=> y['weight'] }
|
31
31
|
self.data[k] = ''
|
32
32
|
zone.each do |i|
|
33
33
|
self.data[k] << i['rendered_html']
|
@@ -5,31 +5,33 @@ module Jekyll
|
|
5
5
|
|
6
6
|
def generate(site)
|
7
7
|
site.config['attendease']['pages'].each do |page|
|
8
|
-
|
8
|
+
if !page['permanent']
|
9
|
+
site.pages << SitePage.new(site, site.source, page)
|
9
10
|
|
10
|
-
|
11
|
+
zones = {}
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
if page['block_instances'].length
|
14
|
+
# create zone buckets
|
15
|
+
page['block_instances'].each do |i|
|
16
|
+
zones[i['zone']] = [] if zones[i['zone']].nil?
|
17
|
+
zones[i['zone']] << i
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
# sort each bucket by widget weight
|
21
|
+
zones.each do |k, zone|
|
22
|
+
zone.sort! { |x, y| x['weight'] <=> y['weight'] }
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
page_source_path = File.join(site.source, page['slug'])
|
26
|
+
FileUtils.mkdir_p(page_source_path) unless File.exists?(page_source_path)
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
File.open(File.join(page_source_path, 'index.json'), 'w') do |f|
|
29
|
+
f.write zones.to_json
|
30
|
+
f.close
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
+
site.static_files << StaticFile.new(site, site.source, File.join('', page['slug']), 'index.json')
|
34
|
+
end
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -5,8 +5,7 @@ module Jekyll
|
|
5
5
|
|
6
6
|
def generate(site)
|
7
7
|
if site.config['attendease']['has_sponsors']
|
8
|
-
|
9
|
-
sponsors = JSON.parse(File.read("#{@attendease_data_path}/sponsors.json"))
|
8
|
+
sponsors = site.data['sponsors']
|
10
9
|
|
11
10
|
sponsor_levels = site.config['attendease']['event']['sponsor_levels']
|
12
11
|
sponsor_levels.each do |level|
|
@@ -8,28 +8,28 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
|
|
8
8
|
#pending 'downloads data and populates the site.config variable' do
|
9
9
|
#end
|
10
10
|
it 'populates a site wide presenters array' do
|
11
|
-
expect(@site.
|
12
|
-
expect(@site.
|
11
|
+
expect(@site.data['presenters'].class).to eq(Array)
|
12
|
+
expect(@site.data['presenters'].length).to eq(2)
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'populates a site wide rooms array' do
|
16
|
-
expect(@site.
|
17
|
-
expect(@site.
|
16
|
+
expect(@site.data['rooms'].class).to eq(Array)
|
17
|
+
expect(@site.data['rooms'].length).to eq(1)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'populates a site wide sessions array' do
|
21
|
-
expect(@site.
|
22
|
-
expect(@site.
|
21
|
+
expect(@site.data['sessions'].class).to eq(Array)
|
22
|
+
expect(@site.data['sessions'].length).to eq(3)
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'populates a site wide venues array' do
|
26
|
-
expect(@site.
|
27
|
-
expect(@site.
|
26
|
+
expect(@site.data['venues'].class).to eq(Array)
|
27
|
+
expect(@site.data['venues'].length).to eq(2)
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'populates a site wide filters array' do
|
31
|
-
expect(@site.
|
32
|
-
expect(@site.
|
31
|
+
expect(@site.data['filters'].class).to eq(Array)
|
32
|
+
expect(@site.data['filters'].length).to eq(1)
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'populates a site wide days array' do
|
@@ -38,12 +38,17 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'populates a site wide sponsors array' do
|
41
|
-
expect(@site.
|
42
|
-
expect(@site.
|
41
|
+
expect(@site.data['sponsors'].class).to eq(Array)
|
42
|
+
expect(@site.data['sponsors'].length).to eq(1)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'populates a site wide pages array' do
|
46
|
+
expect(@site.data['pages'].class).to eq(Array)
|
47
|
+
expect(@site.data['pages'].length).to eq(10)
|
43
48
|
end
|
44
49
|
|
45
50
|
it 'populates a site wide event object' do
|
46
|
-
expect(@site.
|
51
|
+
expect(@site.data['event'].class).to eq(Hash)
|
47
52
|
end
|
48
53
|
|
49
54
|
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::EventLayoutGenerator do
|
4
4
|
|
5
5
|
it 'creates the pre-compiled layout stubs' do
|
6
|
-
%w{ layout register surveys
|
6
|
+
%w{ layout register surveys }.each do |layout|
|
7
7
|
expect(File.exists?(File.join(@site.config['destination'], 'attendease_layouts', "#{layout}.html"))).to eq(true)
|
8
8
|
end
|
9
9
|
end
|
@@ -13,38 +13,38 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'creates a presenters index page' do
|
16
|
-
file = File.join(@site.
|
16
|
+
file = File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file)
|
17
17
|
expect(File.exists?(file)).to eq(true)
|
18
18
|
expect(File.file?(file)).to eq(true)
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'creates a presenter page' do
|
22
|
-
file = File.join(@site.
|
22
|
+
file = File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug)
|
23
23
|
expect(File.exists?(file)).to eq(true)
|
24
24
|
expect(File.file?(file)).to eq(true)
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'creates a schedule index page' do
|
28
|
-
file = File.join(@site.
|
28
|
+
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @index_file)
|
29
29
|
expect(File.exists?(file)).to eq(true)
|
30
30
|
expect(File.file?(file)).to eq(true)
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'creates a schedule day index page' do
|
34
|
-
file = File.join(@site.
|
34
|
+
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @date, @index_file)
|
35
35
|
expect(File.exists?(file)).to eq(true)
|
36
36
|
expect(File.file?(file)).to eq(true)
|
37
|
-
expect(File.read(File.join(@site.
|
37
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @index_file))).to include 'attendease-session-and-instance'
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'creates a schedule sessions index page' do
|
41
|
-
file = File.join(@site.
|
41
|
+
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @index_file)
|
42
42
|
expect(File.exists?(file)).to eq(true)
|
43
43
|
expect(File.file?(file)).to eq(true)
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'creates a schedule session page' do
|
47
|
-
file = File.join(@site.
|
47
|
+
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug)
|
48
48
|
expect(File.exists?(file)).to eq(true)
|
49
49
|
expect(File.file?(file)).to eq(true)
|
50
50
|
end
|
@@ -61,7 +61,7 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'creates a schedule session page for the name' do
|
64
|
-
file = File.join(@site.
|
64
|
+
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug_localized)
|
65
65
|
expect(File.exists?(file)).to eq(true)
|
66
66
|
expect(File.file?(file)).to eq(true)
|
67
67
|
end
|
@@ -71,7 +71,7 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'creates a presenter page' do
|
74
|
-
file = File.join(@site.
|
74
|
+
file = File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug_localized)
|
75
75
|
expect(File.exists?(file)).to eq(true)
|
76
76
|
expect(File.file?(file)).to eq(true)
|
77
77
|
end
|
@@ -81,7 +81,7 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'creates a venue page' do
|
84
|
-
file = File.join(@site.
|
84
|
+
file = File.join(@site.dest, @site.config['attendease']['venues_path_name'], @venue_slug_localized)
|
85
85
|
expect(File.exists?(file)).to eq(true)
|
86
86
|
expect(File.file?(file)).to eq(true)
|
87
87
|
end
|
@@ -89,17 +89,17 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
89
89
|
|
90
90
|
context 'presenter linking' do
|
91
91
|
it 'links presenters correctly from the presenter index page' do
|
92
|
-
expect(File.read(File.join(@site.
|
92
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to include @presenter_slug
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'links presenters correctly from the session page' do
|
96
|
-
expect(File.read(File.join(@site.
|
96
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug))).to include @presenter_slug
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
100
|
context 'a single venue' do
|
101
101
|
pending 'creates a venue index page' do
|
102
|
-
file = File.join(@site.
|
102
|
+
file = File.join(@site.dest, @site.config['attendease']['venue_path_name'], @index_file)
|
103
103
|
expect(File.exists?(file)).to eq(true)
|
104
104
|
expect(File.file?(file)).to eq(true)
|
105
105
|
end
|
@@ -107,13 +107,13 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
107
107
|
|
108
108
|
context 'multiple venues' do
|
109
109
|
it 'creates a venue index page' do
|
110
|
-
file = File.join(@site.
|
110
|
+
file = File.join(@site.dest, @site.config['attendease']['venues_path_name'], @index_file)
|
111
111
|
expect(File.exists?(file)).to eq(true)
|
112
112
|
expect(File.file?(file)).to eq(true)
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'creates a venue page' do
|
116
|
-
file = File.join(@site.
|
116
|
+
file = File.join(@site.dest, @site.config['attendease']['venues_path_name'], @venue_slug)
|
117
117
|
expect(File.exists?(file)).to eq(true)
|
118
118
|
expect(File.file?(file)).to eq(true)
|
119
119
|
end
|
@@ -121,40 +121,40 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
121
121
|
|
122
122
|
context 'presenter social links' do
|
123
123
|
it 'includes the included social links' do
|
124
|
-
expect(File.read(File.join(@site.
|
125
|
-
expect(File.read(File.join(@site.
|
124
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to include "twitter.com/#{@presenter_social['twitter']}"
|
125
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to include "facebook.com/#{@presenter_social['facebook']}"
|
126
126
|
|
127
|
-
expect(File.read(File.join(@site.
|
128
|
-
expect(File.read(File.join(@site.
|
127
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug))).to include "twitter.com/#{@presenter_social['twitter']}"
|
128
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug))).to include "facebook.com/#{@presenter_social['facebook']}"
|
129
129
|
end
|
130
130
|
|
131
131
|
it 'does not include social links that are not there' do
|
132
|
-
expect(File.read(File.join(@site.
|
133
|
-
expect(File.read(File.join(@site.
|
132
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to_not include "linkedin"
|
133
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to_not include "googleplus"
|
134
134
|
|
135
|
-
expect(File.read(File.join(@site.
|
136
|
-
expect(File.read(File.join(@site.
|
135
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug))).to_not include "linkedin"
|
136
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug))).to_not include "googleplus"
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
140
|
context 'venue linking' do
|
141
141
|
it 'links venues correctly from the venue index page' do
|
142
|
-
expect(File.read(File.join(@site.
|
142
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['venues_path_name'], @index_file))).to include @venue_slug
|
143
143
|
end
|
144
144
|
|
145
145
|
it 'links venues correctly from the presenter page' do
|
146
|
-
expect(File.read(File.join(@site.
|
146
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug))).to include @venue_slug
|
147
147
|
end
|
148
148
|
|
149
149
|
it 'links venues correctly from the session page' do
|
150
|
-
expect(File.read(File.join(@site.
|
150
|
+
expect(File.read(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug))).to include @venue_slug
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
154
|
context 'in a site with attendease.show_schedule_index = true' do
|
155
155
|
it 'creates the day index page and show schedule widget' do
|
156
156
|
site = build_site({ 'attendease' => { 'show_schedule_index' => true } })
|
157
|
-
expect(File.read(File.join(site.
|
157
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['schedule_path_name'], @index_file))).to include 'attendease-schedule-widget'
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
@@ -164,7 +164,7 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
164
164
|
@schedule_generator = find_generator(described_class)
|
165
165
|
session_slug = @schedule_generator.schedule_data.sessions.first['slug']
|
166
166
|
|
167
|
-
expect(File.exists?(File.join(@site.
|
167
|
+
expect(File.exists?(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', session_slug))).to eq(true)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -172,25 +172,25 @@ RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
|
172
172
|
it 'no schedule folder exists' do
|
173
173
|
@site = build_site({ 'attendease' => { 'schedule_path_name' => false } })
|
174
174
|
|
175
|
-
expect(File.exists?(File.join(@site.
|
175
|
+
expect(File.exists?(File.join(@site.dest, 'schedule', 'index.html'))).to eq(false)
|
176
176
|
end
|
177
177
|
|
178
178
|
it 'no presenters folder exists' do
|
179
179
|
@site = build_site({ 'attendease' => { 'presenters_path_name' => false } })
|
180
180
|
|
181
|
-
expect(File.exists?(File.join(@site.
|
181
|
+
expect(File.exists?(File.join(@site.dest, 'presenters', 'index.html'))).to eq(false)
|
182
182
|
end
|
183
183
|
|
184
184
|
it 'no venues folder exists' do
|
185
185
|
@site = build_site({ 'attendease' => { 'venues_path_name' => false, 'venue_path_name' => false } })
|
186
186
|
|
187
|
-
expect(File.exists?(File.join(@site.
|
187
|
+
expect(File.exists?(File.join(@site.dest, 'venues', 'index.html'))).to eq(false)
|
188
188
|
end
|
189
189
|
|
190
190
|
it 'no sponsors folder exists' do
|
191
191
|
@site = build_site({ 'attendease' => { 'sponsors_path_name' => false } })
|
192
192
|
|
193
|
-
expect(File.exists?(File.join(@site.
|
193
|
+
expect(File.exists?(File.join(@site.dest, 'sponsors', 'index.html'))).to eq(false)
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
@@ -5,7 +5,7 @@ RSpec.describe Jekyll::AttendeasePlugin::SitePage do
|
|
5
5
|
@site_page = find_page(described_class, Proc.new { |p| p.data['site_page']['slug'] == 'test' })
|
6
6
|
end
|
7
7
|
|
8
|
-
|
8
|
+
pending 'fills the page zones with the rendered html' do
|
9
9
|
expect(@site_page.data['dropzone1']).to eq('<h1>Hello world</h1>')
|
10
10
|
end
|
11
11
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -77,7 +77,7 @@ RSpec.configure do |config|
|
|
77
77
|
'generate_schedule_pages' => true,
|
78
78
|
'has_sessions' => true,
|
79
79
|
'has_presenters' => true,
|
80
|
-
'has_sponsors' =>
|
80
|
+
'has_sponsors' => true,
|
81
81
|
'has_rooms' => true,
|
82
82
|
'has_filters' => true,
|
83
83
|
'has_venues' => true
|
@@ -93,7 +93,12 @@ RSpec.configure do |config|
|
|
93
93
|
|
94
94
|
config.after(:all) do
|
95
95
|
@dest.rmtree if @dest.exist?
|
96
|
-
fixtures_path.join('_attendease', 'templates').rmtree if fixtures_path.join('_attendease', 'templates')
|
97
|
-
fixtures_path.join('attendease_layouts').rmtree if fixtures_path.join('attendease_layouts')
|
96
|
+
fixtures_path.join('_attendease', 'templates').rmtree if File.exists?(fixtures_path.join('_attendease', 'templates'))
|
97
|
+
fixtures_path.join('attendease_layouts').rmtree if File.exists?(fixtures_path.join('attendease_layouts'))
|
98
|
+
Dir.glob(File.join(@source, '**', 'index.json')).map do |i|
|
99
|
+
puts "Removing #{Pathname.new(i).parent}"
|
100
|
+
|
101
|
+
FileUtils.rm_r Pathname.new(i).parent
|
102
|
+
end
|
98
103
|
end
|
99
104
|
end
|