jekyll-attendease 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jekyll-attendease.rb +46 -0
- metadata +1 -1
data/lib/jekyll-attendease.rb
CHANGED
@@ -60,6 +60,36 @@ module Jekyll
|
|
60
60
|
raise "Event data not found, is your Attendease api_host site properly in _config.yml?"
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
# Schedule test pages, so we can style the forms!
|
65
|
+
pages_to_fetch = ['schedule', 'session']
|
66
|
+
|
67
|
+
pages_to_fetch.each do |page|
|
68
|
+
page_data = HTTParty.get("#{attendease_config['api_host']}attendease/preview/#{page}.html")
|
69
|
+
|
70
|
+
if page_data.response.code.to_i == 200
|
71
|
+
puts " [Attendease] Saving test data for schedule page (#{page})..."
|
72
|
+
|
73
|
+
File.open("#{attendease_data_path}/attendease_test_#{page}.html", 'w+') { |file| file.write(page_data.parsed_response) }
|
74
|
+
else
|
75
|
+
raise "Event data not found, is your Attendease api_host site properly in _config.yml?"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Presenter test pages, so we can style the forms!
|
80
|
+
pages_to_fetch = ['presenters', 'presenter']
|
81
|
+
|
82
|
+
pages_to_fetch.each do |page|
|
83
|
+
page_data = HTTParty.get("#{attendease_config['api_host']}attendease/preview/#{page}.html")
|
84
|
+
|
85
|
+
if page_data.response.code.to_i == 200
|
86
|
+
puts " [Attendease] Saving test data for presenter page (#{page})..."
|
87
|
+
|
88
|
+
File.open("#{attendease_data_path}/attendease_test_#{page}.html", 'w+') { |file| file.write(page_data.parsed_response) }
|
89
|
+
else
|
90
|
+
raise "Event data not found, is your Attendease api_host site properly in _config.yml?"
|
91
|
+
end
|
92
|
+
end
|
63
93
|
end
|
64
94
|
|
65
95
|
# Adding to site config so we can access these variables globally wihtout using a Liquid Tag so we can use if/else
|
@@ -132,6 +162,18 @@ layout: layout
|
|
132
162
|
|
133
163
|
puts " [Attendease] Generating /register/dashboard.html"
|
134
164
|
site.pages << RegisterTestPage.new(site, site.source, File.join('register'), {:name => 'dashboard.html', :liquid_tag => 'attendease_test_register_dashboard'})
|
165
|
+
|
166
|
+
puts " [Attendease] Generating /presenters/index.html"
|
167
|
+
site.pages << RegisterTestPage.new(site, site.source, File.join('presenters'), {:name => 'index.html', :liquid_tag => 'attendease_test_presenters'})
|
168
|
+
|
169
|
+
puts " [Attendease] Generating /presenters/presenter.html"
|
170
|
+
site.pages << RegisterTestPage.new(site, site.source, File.join('presenters'), {:name => 'presenter.html', :liquid_tag => 'attendease_test_presenter'})
|
171
|
+
|
172
|
+
puts " [Attendease] Generating /schedule/index.html"
|
173
|
+
site.pages << RegisterTestPage.new(site, site.source, File.join('schedule'), {:name => 'index.html', :liquid_tag => 'attendease_test_schedule'})
|
174
|
+
|
175
|
+
puts " [Attendease] Generating /schedule/session.html"
|
176
|
+
site.pages << RegisterTestPage.new(site, site.source, File.join('schedule'), {:name => 'session.html', :liquid_tag => 'attendease_test_session'})
|
135
177
|
end
|
136
178
|
|
137
179
|
end
|
@@ -189,3 +231,7 @@ Liquid::Template.register_tag('attendease_content', Jekyll::Attendease::Attendea
|
|
189
231
|
Liquid::Template.register_tag('attendease_test_register_choose_pass', Jekyll::Attendease::AttendeaseTest)
|
190
232
|
Liquid::Template.register_tag('attendease_test_register_checkout', Jekyll::Attendease::AttendeaseTest)
|
191
233
|
Liquid::Template.register_tag('attendease_test_register_dashboard', Jekyll::Attendease::AttendeaseTest)
|
234
|
+
Liquid::Template.register_tag('attendease_test_schedule', Jekyll::Attendease::AttendeaseTest)
|
235
|
+
Liquid::Template.register_tag('attendease_test_session', Jekyll::Attendease::AttendeaseTest)
|
236
|
+
Liquid::Template.register_tag('attendease_test_presenters', Jekyll::Attendease::AttendeaseTest)
|
237
|
+
Liquid::Template.register_tag('attendease_test_presenter', Jekyll::Attendease::AttendeaseTest)
|