jekyll-attendease 0.6.1 → 0.6.2.pre

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: 00c6babd1870a4e7bf21953cac303f50e3279816
4
- data.tar.gz: 42ddbde603be6c2d82b25ad25becd8248f4a88cf
3
+ metadata.gz: 5e82bfbb32172afdd9527910b6ee9aa514ac7424
4
+ data.tar.gz: 6a0f6cf1dfcd936ccf12fcea52de932872392c41
5
5
  SHA512:
6
- metadata.gz: 3028a82d5c90d131c9cdfc2579d1ff3347ae14eaa1c97bffee5ecdab9cc7cae97004c338dbbaa7ca051d84f49c0a6d8da7c82e8dbd270b6a1d6dd27390bedfd2
7
- data.tar.gz: a08e3ff4945fa97061a8e2575bc7c24085ffa35d2f6512fe381893bab7ea94403e17133b88d2a6793170990c983b22768157561b19ec634a14d8a121ea1a7ff3
6
+ metadata.gz: 9bc7cff588bb05f24d406bb88a172408aa96b9cdd4afd315cbe07491de670bacc0a8193d354b2279ee1770e5b9d5c67eca41bc2c6b4ff117fbae6ff181171713
7
+ data.tar.gz: 9f6cade078d100bd60d7b69ff566b14781587d636c969f9ad4de85e069224a65272c942c65f6a3d6acc7b3c89754de0b9bb726ccc58f7508c263f4ccd8588859
@@ -8,6 +8,7 @@ require 'jekyll/attendease_plugin/tags'
8
8
  require 'jekyll/attendease_plugin/filters'
9
9
  require 'jekyll/attendease_plugin/helpers'
10
10
 
11
+ require 'jekyll/attendease_plugin/event_layout_page'
11
12
  require 'jekyll/attendease_plugin/presenters_index_page'
12
13
  require 'jekyll/attendease_plugin/presenter_page'
13
14
  require 'jekyll/attendease_plugin/schedule_day_page'
@@ -1,6 +1,6 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- class EventDataGenerator < ::Jekyll::Generator
3
+ class EventDataGenerator < Generator
4
4
  safe true
5
5
 
6
6
  priority :highest
@@ -1,6 +1,6 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- class EventLayoutGenerator < ::Jekyll::Generator
3
+ class EventLayoutGenerator < Generator
4
4
  safe true
5
5
 
6
6
  priority :high
@@ -8,35 +8,78 @@ module Jekyll
8
8
  def generate(site)
9
9
  Jekyll.logger.debug "[Attendease] Generating theme layouts..."
10
10
 
11
- attendease_precompiled_theme_layouts_path = File.join(site.source, 'attendease_layouts')
11
+ attendease_precompiled_theme_layouts_path = File.join(site.source, 'attendease_layouts') # These are compiled to the html site.
12
+ attendease_precompiled_theme_email_layouts_path = File.join(site.source, 'attendease_layouts', 'emails') # These are compiled for email.
13
+ attendease_theme_layouts_path = File.join(site.source, '_attendease', 'layouts') # These are used for page generation (no output html file needed)
12
14
 
13
15
  FileUtils.mkdir_p(attendease_precompiled_theme_layouts_path)
16
+ FileUtils.mkdir_p(attendease_theme_layouts_path)
14
17
 
15
- base_layout = site.config['attendease']['base_layout']
16
18
 
17
- layouts_to_precompile = %w{ layout register schedule presenters venues sponsors }
19
+ # Precompiled layouts for attendease app and jekyll generated pages.
20
+ base_layout = site.config['attendease']['base_layout'] || 'layout'
18
21
 
19
- # Precompiled layout for website sections.
22
+ base_layout_file = File.join(site.source, '_layouts', "#{base_layout}.html")
23
+ unless File.exists?(base_layout_file)
24
+ # Generate an extremely simple base layout if it does not exist.
25
+ File.open(base_layout_file, 'w+') { |f| f.write("{{ content }}") }
26
+ end
27
+
28
+ layouts_to_precompile = %w{ layout register surveys } # These are compiled to the html site.
20
29
  layouts_to_precompile.each do |layout|
21
- if File.exists?(File.join(site.source, 'attendease_layouts', "#{base_layout}.html"))
22
- # create a layout file if it already doesn't exist.
23
- # the layout file will be used by attendease to wrap /register, /schedule, /presenters in the
24
- # look the compiled file defines.
25
- # ensure {{ content }} is in the file so we can render content in there!
26
- unless File.exists?(File.join(attendease_precompiled_theme_layouts_path, "#{layout}.html"))
27
- FileUtils.cp File.join(site.source, 'attendease_layouts', "#{base_layout}.html"), File.join(site.source, 'attendease_layouts', "#{layout}.html")
28
- #site.pages << LayoutPage.new(site, site.source, 'attendease_layouts', "#{layout}.html", base_layout)
29
- end
30
- else
31
- Jekyll.logger.debug "Could not find attendease_layouts/#{base_layout}.html in your site source. Using the built-in template from jekyll-attendease."
32
- #FileUtils.cp File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates', 'layout.html')), File.join(site.source, 'attendease_layouts', "#{base_layout}.html")
30
+ # create a layout file if it already doesn't exist.
31
+ # the layout file will be used by attendease to wrap /register, /schedule, /presenters, '/surveys'
32
+ # in the look these compiled file define.
33
+ # ensure {{ content }} is in the file so we can render content in there!
34
+ unless File.exists?(File.join(attendease_precompiled_theme_layouts_path, "#{layout}.html"))
35
+ site.pages << EventLayoutPage.new(site, site.source, 'attendease_layouts', "#{layout}.html", base_layout, layout.capitalize)
36
+ end
37
+ end
38
+
39
+
40
+ # Precompiled layouts for attendease email
41
+ base_email_layout = site.config['attendease']['base_email_layout'] || 'email'
42
+ base_email_layout_file = File.join(site.source, '_layouts', "#{base_email_layout}.html")
43
+ unless File.exists?(base_email_layout_file)
44
+ # Generate an extremely simple base email layout if it does not exist.
45
+ File.open(base_email_layout_file, 'w+') { |f| f.write("{{ content }}") }
46
+ end
47
+
48
+ layouts_to_precompile = %w{ layout } # These are pre-compiled for email.
49
+ layouts_to_precompile.each do |layout|
50
+ # create a layout file if it already doesn't exist.
51
+ unless File.exists?(File.join(attendease_precompiled_theme_email_layouts_path, "#{layout}.html"))
52
+ site.pages << EventLayoutPage.new(site, site.source, 'attendease_layouts/emails', "#{layout}.html", base_email_layout, layout.capitalize)
53
+ end
54
+ end
55
+
56
+
57
+ # Layouts to use for page generation. (These layouts do not need to be part of the html output)
58
+ layouts_for_page_generation = %w{ layout schedule presenters venues sponsors }
59
+
60
+ source_template = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates', 'layout.html'))
61
+ html = Liquid::Template.parse(File.read(source_template)).render('page' => { 'base_layout' => base_layout })
62
+
63
+ layouts_for_page_generation.each do |layout|
64
+ base_layout_path = File.join(site.source, '_layouts', "#{base_layout}.html")
65
+
66
+ unless File.exists?(base_layout_path)
67
+ Jekyll.logger.debug "Could not find _layouts/#{base_layout}.html in your site source. Using the built-in template from jekyll-attendease."
68
+
33
69
  source_template = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates', 'layout.html'))
34
70
  html = Liquid::Template.parse(File.read(source_template)).render('page' => { 'base_layout' => base_layout })
35
71
 
36
- File.open(File.join(site.source, 'attendease_layouts', "#{base_layout}.html"), 'w') { |f| f.write(html) }
37
- #site.pages << LayoutPage.new(site, site.source, 'attendease_layouts', "#{layout}.html", base_layout)
72
+ File.open(base_layout_path, 'w') { |f| f.write(html) }
73
+ end
74
+
75
+ layout_path = File.join(attendease_theme_layouts_path, "#{layout}.html")
76
+
77
+ unless File.exists?(layout_path)
78
+ #puts "generating #{layout}.html..."
79
+ File.open(layout_path, 'w') { |f| f.write(html) }
38
80
  end
39
81
  end
82
+
40
83
  end
41
84
  end
42
85
  end
@@ -0,0 +1,27 @@
1
+ module Jekyll
2
+ module AttendeasePlugin
3
+ class EventLayoutPage < Page
4
+ def initialize(site, base, dir, name, base_layout, title_prefix)
5
+ @site = site
6
+ @base = base
7
+ @dir = dir
8
+ @name = name
9
+
10
+ self.process(name)
11
+
12
+ self.read_yaml(File.join(base, '_layouts'), "#{base_layout}.html")
13
+
14
+ self.data = {}
15
+
16
+ self.data['layout'] = base_layout
17
+ self.data['base_layout'] = base_layout
18
+
19
+ title_prefix = 'Hello' if title_prefix == 'Layout' # Use "Hello" for the title of the main layout page.
20
+
21
+ self.data['title'] = title_prefix
22
+
23
+ self.content = "{% raw %}{{ content }}{% endraw %}"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'presenters.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'presenters.html')
13
13
 
14
14
  presenter_page_title = site.config['presenter_page_title'] ? site.config['presenter_page_title'] : 'Presenter: %s'
15
15
  self.data['title'] = sprintf(presenter_page_title, presenter['first_name'] + ' ' + presenter['last_name'])
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'presenters.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'presenters.html')
13
13
 
14
14
  self.data['title'] = site.config['presenters_index_title'] || 'Presenters'
15
15
 
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'layout.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'layout.html')
13
13
  self.data = {}
14
14
 
15
15
  self.data['redirect_url'] = redirect_url
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'schedule.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'schedule.html')
13
13
 
14
14
  session_day_title_prefix = site.config['schedule_day_title_prefix'] || 'Schedule: '
15
15
  self.data['title'] = "#{session_day_title_prefix}#{day['date_formatted']}"
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'schedule.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'schedule.html')
13
13
 
14
14
  self.data['title'] = site.config['schedule_index_title_prefix'] || 'Schedule'
15
15
 
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'schedule.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'schedule.html')
13
13
 
14
14
  schedule_session_page_title = site.config['schedule_session_page_title'] || 'Schedule: %s'
15
15
  self.data['title'] = sprintf(schedule_session_page_title, session['name'])
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'schedule.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'schedule.html')
13
13
 
14
14
  self.data['title'] = site.config['schedule_sessions_title'] || 'Schedule: Sessions'
15
15
 
@@ -1,6 +1,6 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- class SponsorGenerator < ::Jekyll::Generator
3
+ class SponsorGenerator < Generator
4
4
  safe true
5
5
 
6
6
  def generate(site)
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'sponsors.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'sponsors.html')
13
13
 
14
14
  self.data['title'] = site.config['sponsors_index_title'] || 'Sponsors'
15
15
 
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'venues.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'venues.html')
13
13
 
14
14
  venue_page_title = site.config['venue_page_title'] ? site.config['venue_page_title'] : 'Venue: %s'
15
15
  self.data['title'] = sprintf(venue_page_title, venue['name'])
@@ -9,7 +9,7 @@ module Jekyll
9
9
 
10
10
  self.process(@name)
11
11
 
12
- self.read_yaml(File.join(base, 'attendease_layouts'), 'venues.html')
12
+ self.read_yaml(File.join(base, '_attendease', 'layouts'), 'venues.html')
13
13
 
14
14
  self.data['title'] = site.config['venues_index_title'] || 'Venues'
15
15
 
@@ -1,6 +1,6 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2.pre"
4
4
  end
5
5
  end
6
6
 
@@ -2,9 +2,21 @@ require 'spec_helper'
2
2
 
3
3
  RSpec.describe Jekyll::AttendeasePlugin::EventLayoutGenerator do
4
4
 
5
- it 'creates the layout stubs' do
6
- %w{ layout register schedule presenters venues sponsors }.each do |layout|
7
- expect(File.exists?(File.join(@site.source, 'attendease_layouts', "#{layout}.html"))).to eq(true)
5
+ it 'creates the generated page layout stubs' do
6
+ %w{ layout schedule presenters venues sponsors }.each do |layout|
7
+ expect(File.exists?(File.join(@site.source, '_attendease', 'layouts', "#{layout}.html"))).to eq(true)
8
+ end
9
+ end
10
+
11
+ it 'creates the pre-compiled layout stubs' do
12
+ %w{ layout register surveys }.each do |layout|
13
+ expect(File.exists?(File.join(@site.config['destination'], 'attendease_layouts', "#{layout}.html"))).to eq(true)
14
+ end
15
+ end
16
+
17
+ it 'creates the pre-compiled email layout stubs' do
18
+ %w{ layout }.each do |layout|
19
+ expect(File.exists?(File.join(@site.config['destination'], 'attendease_layouts', 'emails', "#{layout}.html"))).to eq(true)
8
20
  end
9
21
  end
10
22
 
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.1
4
+ version: 0.6.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wood
@@ -16,98 +16,98 @@ dependencies:
16
16
  name: httparty
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 0.13.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: 0.13.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: json
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ~>
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: 1.8.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.8.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: i18n
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.6.9
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ~>
54
+ - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 0.6.9
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: redcarpet
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 2.3.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: 2.3.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: bundler
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ~>
75
+ - - "~>"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '1.3'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ~>
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.3'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rake
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - '>='
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: rspec
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - '>='
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  - !ruby/object:Gem::Dependency
@@ -130,8 +130,11 @@ executables: []
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
+ - lib/jekyll-attendease.rb
134
+ - lib/jekyll/attendease_plugin.rb
133
135
  - lib/jekyll/attendease_plugin/event_data_generator.rb
134
136
  - lib/jekyll/attendease_plugin/event_layout_generator.rb
137
+ - lib/jekyll/attendease_plugin/event_layout_page.rb
135
138
  - lib/jekyll/attendease_plugin/filters.rb
136
139
  - lib/jekyll/attendease_plugin/helpers.rb
137
140
  - lib/jekyll/attendease_plugin/pre_zero_point_six_link_redirect_generator.rb
@@ -149,8 +152,16 @@ files:
149
152
  - lib/jekyll/attendease_plugin/venue_page.rb
150
153
  - lib/jekyll/attendease_plugin/venues_index_page.rb
151
154
  - lib/jekyll/attendease_plugin/version.rb
152
- - lib/jekyll/attendease_plugin.rb
153
- - lib/jekyll-attendease.rb
155
+ - spec/lib/jekyll/attendease_plugin/event_data_generator_spec.rb
156
+ - spec/lib/jekyll/attendease_plugin/event_layout_generator_spec.rb
157
+ - spec/lib/jekyll/attendease_plugin/filters_spec.rb
158
+ - spec/lib/jekyll/attendease_plugin/helpers_spec.rb
159
+ - spec/lib/jekyll/attendease_plugin/pre_zero_point_six_link_redirect_generator_spec.rb
160
+ - spec/lib/jekyll/attendease_plugin/schedule_generator_spec.rb
161
+ - spec/lib/jekyll/attendease_plugin/sponsor_generator_spec.rb
162
+ - spec/lib/jekyll/attendease_plugin/tags_spec.rb
163
+ - spec/spec_helper.rb
164
+ - spec/support/fixtures_helpers.rb
154
165
  - templates/_includes/attendease/presenters/index.html
155
166
  - templates/_includes/attendease/presenters/presenter.html
156
167
  - templates/_includes/attendease/redirect.html
@@ -162,16 +173,6 @@ files:
162
173
  - templates/_includes/attendease/venues/index.html
163
174
  - templates/_includes/attendease/venues/venue.html
164
175
  - templates/layout.html
165
- - spec/lib/jekyll/attendease_plugin/event_data_generator_spec.rb
166
- - spec/lib/jekyll/attendease_plugin/event_layout_generator_spec.rb
167
- - spec/lib/jekyll/attendease_plugin/filters_spec.rb
168
- - spec/lib/jekyll/attendease_plugin/helpers_spec.rb
169
- - spec/lib/jekyll/attendease_plugin/pre_zero_point_six_link_redirect_generator_spec.rb
170
- - spec/lib/jekyll/attendease_plugin/schedule_generator_spec.rb
171
- - spec/lib/jekyll/attendease_plugin/sponsor_generator_spec.rb
172
- - spec/lib/jekyll/attendease_plugin/tags_spec.rb
173
- - spec/spec_helper.rb
174
- - spec/support/fixtures_helpers.rb
175
176
  homepage: https://attendease.com/
176
177
  licenses:
177
178
  - MIT
@@ -182,17 +183,17 @@ require_paths:
182
183
  - lib
183
184
  required_ruby_version: !ruby/object:Gem::Requirement
184
185
  requirements:
185
- - - '>='
186
+ - - ">="
186
187
  - !ruby/object:Gem::Version
187
188
  version: '0'
188
189
  required_rubygems_version: !ruby/object:Gem::Requirement
189
190
  requirements:
190
- - - '>='
191
+ - - ">"
191
192
  - !ruby/object:Gem::Version
192
- version: '0'
193
+ version: 1.3.1
193
194
  requirements: []
194
195
  rubyforge_project:
195
- rubygems_version: 2.0.3
196
+ rubygems_version: 2.2.2
196
197
  signing_key:
197
198
  specification_version: 4
198
199
  summary: Attendease event helper for Jekyll