jekyll-attendease 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +13 -0
  2. data/lib/jekyll-attendease.rb +8 -2
  3. metadata +1 -1
data/README.md CHANGED
@@ -38,6 +38,19 @@ attendease:
38
38
 
39
39
  Remember to replace `https://your-event-subdomain.attendease.com/` with your actual event url, or crazy things will happen!
40
40
 
41
+ ## Usage
42
+
43
+ Now the event name can easily be used in your site like so:
44
+
45
+ `{{ site.attendease.data.attendease_event_name }}`
46
+
47
+ We can also use logical expressions like so:
48
+
49
+ ```
50
+ {% if site.attendease.data.attendease_has_registration %}
51
+ We have registration!
52
+ {% endif %}
53
+ ```
41
54
 
42
55
  ## Contributing
43
56
 
@@ -8,10 +8,16 @@ module Jekyll
8
8
  def generate(site)
9
9
  if attendease_config = site.config['attendease']
10
10
 
11
- if attendease_config['api_host'] && !attendease_config['api_host'].match(/^http/)
11
+ if attendease_config['api_host'] && !attendease_config['api_host'].match(/^http(.*).attendease.com/)
12
12
  raise "Is your Attendease api_host site properly in _config.yml? Needs to be something like https://myevent.attendease.com/"
13
13
  else
14
- attendease_data_path = File.expand_path("../../_attendease_data", __FILE__)
14
+ # add a trailing slash if we are missing one.
15
+ if attendease_config['api_host'][-1, 1] != '/'
16
+ attendease_config['api_host'] += '/'
17
+ end
18
+
19
+ attendease_data_path = "#{site.config['source']}/_attendease_data"
20
+
15
21
  FileUtils.mkdir_p(attendease_data_path)
16
22
 
17
23
  update_data = true
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jekyll-attendease
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.0
5
+ version: 0.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Wood