jekyll-attendease 0.6.24 → 0.6.25b

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6beeaeee0dec5362fb346a24db9601ffe018e511
4
- data.tar.gz: 17c150fbfdf0a77c76864a9aa08c1ac037336ca6
3
+ metadata.gz: 298b49dc03d53f5a61bb2b34da0efe4fd5146562
4
+ data.tar.gz: 3481dab008802f780c60d3850aae451424872da0
5
5
  SHA512:
6
- metadata.gz: d4a7377680f70e405f170ca7fe3b34a5f267669c40ad3e6db787f8b0e06a1783d4e7eeab71de778a5ffbdaafce394d142e4c17a544c3ca83d50e983fc4482d86
7
- data.tar.gz: 3e7f96e19bef5524f9cd9dd4208ebaf88a18b205b31b3ca7ac34dd5030793fa0c35c8e56abec4fe7c9701b64525181746bd2bf4f460064d569b5bc66d7dcf6cc
6
+ metadata.gz: 1f6567967bfaac467e1fd297d39475374cd55c76541f194fd0e85f769467055eadf0e9bdf9a74689d227dbf4689f6df5fe359b0f6d0999699d2e104a0cb46d15
7
+ data.tar.gz: 205d2f3a17a1c765fb64f0cb83a5bbe6eb95f9ec6d94634773565319bd99ba0fb6d405027366d5de0c1add8fc05281dd9fc71c3517e049855f317152740d7905
@@ -13,5 +13,6 @@ Liquid::Template.register_tag('attendease_locales_script', Jekyll::AttendeaseP
13
13
  Liquid::Template.register_tag('attendease_auth_account', Jekyll::AttendeasePlugin::AuthAccountTag)
14
14
  Liquid::Template.register_tag('attendease_auth_action', Jekyll::AttendeasePlugin::AuthActionTag)
15
15
  Liquid::Template.register_tag('attendease_t', Jekyll::AttendeasePlugin::TranslateTag)
16
+ Liquid::Template.register_tag('attendease_nav', Jekyll::AttendeasePlugin::NavigationTag)
16
17
 
17
18
  Liquid::Template.register_filter(Jekyll::AttendeasePlugin::Filters)
@@ -8,6 +8,7 @@ require 'jekyll/attendease_plugin/event_template_generator'
8
8
  require 'jekyll/attendease_plugin/home_page_generator'
9
9
  require 'jekyll/attendease_plugin/schedule_generator'
10
10
  require 'jekyll/attendease_plugin/sponsor_generator'
11
+ require 'jekyll/attendease_plugin/site_pages_generator'
11
12
  require 'jekyll/attendease_plugin/pre_zero_point_six_link_redirect_generator'
12
13
 
13
14
  # Redirect page
@@ -30,6 +31,7 @@ require 'jekyll/attendease_plugin/schedule_session_page'
30
31
  require 'jekyll/attendease_plugin/sponsors_index_page'
31
32
  require 'jekyll/attendease_plugin/venues_index_page'
32
33
  require 'jekyll/attendease_plugin/venue_page'
34
+ require 'jekyll/attendease_plugin/site_page'
33
35
 
34
36
  # Ve.rs.ion
35
37
  require 'jekyll/attendease_plugin/version'
@@ -34,7 +34,7 @@ module Jekyll
34
34
 
35
35
  FileUtils.mkdir_p(@attendease_data_path)
36
36
 
37
- data_files = %w{ site event sessions presenters rooms filters venues sponsors }.map { |m| "#{m}.json"} << 'lingo.yml'
37
+ data_files = %w{ site event sessions presenters rooms filters venues sponsors pages }.map { |m| "#{m}.json"} << 'lingo.yml'
38
38
 
39
39
  data_files.each do |file_name|
40
40
  update_data = true
@@ -87,6 +87,7 @@ module Jekyll
87
87
 
88
88
  # make this data available to anything that wants it
89
89
  site.config['attendease'][File.basename(file_name, '.*')] = data
90
+ site.data[File.basename(file_name, '.*')] = data
90
91
 
91
92
  if data.is_a?(Hash)
92
93
  if file_name == 'site.json'
@@ -25,7 +25,7 @@ module Jekyll
25
25
  Jekyll.logger.info "[Attendease] Generating theme templates..."
26
26
 
27
27
  # Generate the template files if they don't yet exist.
28
- %w{ schedule presenters venues sponsors}.each do |p|
28
+ %w{ schedule presenters venues sponsors pages }.each do |p|
29
29
  path = File.join(site.source, '_attendease', 'templates', p)
30
30
  FileUtils.mkdir_p(path)
31
31
  raise "Could not create #{path}." unless File.exists?(path)
@@ -54,6 +54,7 @@ EOF
54
54
  venues/index
55
55
  venues/venue
56
56
  sponsors/index
57
+ pages/default
57
58
  }.each do |page|
58
59
  destination_file = File.join(site.source, '_attendease', 'templates', "#{page}.html")
59
60
 
@@ -0,0 +1,20 @@
1
+ module Jekyll
2
+ module AttendeasePlugin
3
+ class SitePage < Page
4
+ def initialize(site, base, page)
5
+ @site = site
6
+ @base = base
7
+ @dir = page['slug']
8
+ @name = 'index.html'
9
+
10
+ self.process(@name)
11
+
12
+ self.read_yaml(File.join(base, '_attendease', 'templates', 'pages'), 'default.html')
13
+
14
+ self.data['title'] = page['title']
15
+
16
+ self.data['site_page'] = page
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ module Jekyll
2
+ module AttendeasePlugin
3
+ class SitePagesGenerator < Generator
4
+ safe true
5
+
6
+ def generate(site)
7
+ site.config['attendease']['pages'].each do |page|
8
+ site.pages << SitePage.new(site, site.source, page)
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -80,6 +80,45 @@ module Jekyll
80
80
  '<div id="attendease-auth-action"></div>'
81
81
  end
82
82
  end
83
+
84
+ #require 'pry'
85
+
86
+ class NavigationTag < Liquid::Block
87
+ def initialize(tag_name, params, tokens)
88
+ super
89
+ @options = {}
90
+ params.split(/\s/).each do |keypair|
91
+ opt = keypair.split('=')
92
+ @options[opt[0]] = opt[1] if opt.length == 2
93
+ end
94
+ end
95
+
96
+ def render(context)
97
+ pages = context.registers[:site].data['pages']
98
+
99
+ config = context.registers[:site].config['attendease']
100
+
101
+ nav = []
102
+ if pages.is_a?(Array)
103
+ pages.sort! { |a, b| a['weight'] <=> b['weight'] }
104
+ key_mapping = { 'schedule' => 'sessions' }
105
+ pages.select { |p| p['top_level'] }.each do |page|
106
+ if page['active'] || !page['hidden']
107
+ # only activate nav links if there is content
108
+ config_key = "has_#{key_mapping[page['page_key']] || page['page_key']}"
109
+ if config[config_key].nil? || (!config[config_key].nil? && config[config_key] == true)
110
+ template = Liquid::Template.parse(super)
111
+ template.assigns['page'] = page
112
+ nav << template.render
113
+ end
114
+ end
115
+ end
116
+ nav.join("\n")
117
+ else
118
+ ''
119
+ end
120
+ end
121
+ end
83
122
  end
84
123
  end
85
124
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- VERSION = '0.6.24'
3
+ VERSION = '0.6.25b'
4
4
  end
5
5
  end
@@ -2,8 +2,50 @@ require 'spec_helper'
2
2
 
3
3
  RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
4
4
 
5
+ before(:all) do
6
+ @event_data_generator = find_generator(described_class)
7
+ end
5
8
  #pending 'downloads data and populates the site.config variable' do
6
9
  #end
10
+ it 'populates a site wide presenters array' do
11
+ expect(@site.config['attendease']['presenters'].class).to eq(Array)
12
+ expect(@site.config['attendease']['presenters'].length).to eq(2)
13
+ end
14
+
15
+ it 'populates a site wide rooms array' do
16
+ expect(@site.config['attendease']['rooms'].class).to eq(Array)
17
+ expect(@site.config['attendease']['rooms'].length).to eq(1)
18
+ end
19
+
20
+ it 'populates a site wide sessions array' do
21
+ expect(@site.config['attendease']['sessions'].class).to eq(Array)
22
+ expect(@site.config['attendease']['sessions'].length).to eq(3)
23
+ end
24
+
25
+ it 'populates a site wide venues array' do
26
+ expect(@site.config['attendease']['venues'].class).to eq(Array)
27
+ expect(@site.config['attendease']['venues'].length).to eq(2)
28
+ end
29
+
30
+ it 'populates a site wide filters array' do
31
+ expect(@site.config['attendease']['filters'].class).to eq(Array)
32
+ expect(@site.config['attendease']['filters'].length).to eq(1)
33
+ end
34
+
35
+ it 'populates a site wide days array' do
36
+ expect(@site.config['attendease']['days'].class).to eq(Array)
37
+ expect(@site.config['attendease']['days'].length).to eq(2)
38
+ end
39
+
40
+ it 'populates a site wide sponsors array' do
41
+ expect(@site.config['attendease']['sponsors'].class).to eq(Array)
42
+ expect(@site.config['attendease']['sponsors'].length).to eq(1)
43
+ end
44
+
45
+ it 'populates a site wide event object' do
46
+ expect(@site.config['attendease']['event'].class).to eq(Hash)
47
+ end
48
+
7
49
 
8
50
  end
9
51
 
@@ -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 }.each do |layout|
6
+ %w{ layout register surveys pages }.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
@@ -50,6 +50,11 @@ RSpec.describe "Jekyll Attendease tags" do
50
50
  expect(subject.gsub(' ', '').gsub("\n", '')).to eq(schedule_widget_data.gsub(' ', '').gsub("\n", ''))
51
51
  end
52
52
  end
53
+
54
+ context "{% attendease_nav %}" do
55
+ subject { render("{% attendease_nav %}{% raw %}<li><a href=\"/{{ page.slug }}/\">{{ page.name }}</a></li>{% endraw %}{% endattendease_nav %}") }
56
+ it { is_expected.to match(/<li><a href="\/schedule\/"/) }
57
+ end
53
58
  end
54
59
 
55
60
  def schedule_widget_data
@@ -65,7 +65,7 @@ RSpec.configure do |config|
65
65
  'generate_schedule_pages' => true,
66
66
  'has_sessions' => true,
67
67
  'has_presenters' => true,
68
- 'has_sponsors' => true,
68
+ 'has_sponsors' => false,
69
69
  'has_rooms' => true,
70
70
  'has_filters' => true,
71
71
  'has_venues' => true
@@ -75,7 +75,7 @@ RSpec.configure do |config|
75
75
 
76
76
  def build_site(config = {})
77
77
  site = Jekyll::Site.new(site_configuration(config))
78
- foo = site.process
78
+ site.process
79
79
  site
80
80
  end
81
81
 
@@ -0,0 +1,3 @@
1
+ <div class="attendease-page-content">
2
+ {{ page.site_page.content }}
3
+ </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-attendease
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.24
4
+ version: 0.6.25b
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wood
@@ -139,6 +139,20 @@ dependencies:
139
139
  - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: pry
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ type: :development
150
+ prerelease: false
151
+ version_requirements: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
142
156
  description: Bring your event data into Jekyll for amazing event websites.
143
157
  email: support@attendease.com
144
158
  executables: []
@@ -165,6 +179,8 @@ files:
165
179
  - lib/jekyll/attendease_plugin/schedule_index_page.rb
166
180
  - lib/jekyll/attendease_plugin/schedule_session_page.rb
167
181
  - lib/jekyll/attendease_plugin/schedule_sessions_page.rb
182
+ - lib/jekyll/attendease_plugin/site_page.rb
183
+ - lib/jekyll/attendease_plugin/site_pages_generator.rb
168
184
  - lib/jekyll/attendease_plugin/sponsor_generator.rb
169
185
  - lib/jekyll/attendease_plugin/sponsors_index_page.rb
170
186
  - lib/jekyll/attendease_plugin/tags.rb
@@ -183,6 +199,7 @@ files:
183
199
  - spec/spec_helper.rb
184
200
  - spec/support/fixtures_helpers.rb
185
201
  - templates/attendease/index.html
202
+ - templates/attendease/pages/default.html
186
203
  - templates/attendease/presenters/index.html
187
204
  - templates/attendease/presenters/presenter.html
188
205
  - templates/attendease/schedule/day.html
@@ -210,9 +227,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
227
  version: '0'
211
228
  required_rubygems_version: !ruby/object:Gem::Requirement
212
229
  requirements:
213
- - - ">="
230
+ - - ">"
214
231
  - !ruby/object:Gem::Version
215
- version: '0'
232
+ version: 1.3.1
216
233
  requirements: []
217
234
  rubyforge_project:
218
235
  rubygems_version: 2.2.5