jekyll-events 0.0.1
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 +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/jekyll-events.gemspec +23 -0
- data/lib/jekyll-events/version.rb +5 -0
- data/lib/jekyll-events.rb +52 -0
- metadata +81 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 4b1a9175a6fd1c13f700f58bb9197c993251f4bd
|
|
4
|
+
data.tar.gz: 647c64628d60d57a12e5a9e7f968529bc2336d0e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c1c921db66cbb0e63cb20def326997733042ef19f10f1380c0e9e35a01dc4a0cbadd720326eff00b198e6669cd32b08b027a2fbe1934ab967c70236ec056f50a
|
|
7
|
+
data.tar.gz: eb55e08d94cd04167ffd20ecabd17fbdd47c29a0f5fac6f03308f39f75f3d370c5fdac1f84939938b68634597c55dac62184a4b73d936cf450e31fe265946af8
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Zach Starkebaum
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# jekyll-events
|
|
2
|
+
|
|
3
|
+
Lets you create posts that represent future events. They're post's but in the future!
|
|
4
|
+
|
|
5
|
+
Basic Setup
|
|
6
|
+
-----------
|
|
7
|
+
Install the gem:
|
|
8
|
+
|
|
9
|
+
[sudo] gem install jekyll-events
|
|
10
|
+
|
|
11
|
+
In a plugin file within your Jekyll project's `_plugins` directory:
|
|
12
|
+
|
|
13
|
+
# _plugins/my-plugin.rb
|
|
14
|
+
require "jekyll-events"
|
|
15
|
+
|
|
16
|
+
Bundler Setup
|
|
17
|
+
-------------
|
|
18
|
+
Using bundler to manage gems for your Jekyll project? Just add
|
|
19
|
+
|
|
20
|
+
gem "jekyll-events"
|
|
21
|
+
|
|
22
|
+
to your gemfile and create the following plugin in your projects `_plugins`
|
|
23
|
+
directory. This will automatically require all of the gems specified in your Gemfile.
|
|
24
|
+
|
|
25
|
+
# _plugins/bundler.rb
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
Bundler.require(:default)
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Anywhere you need some future dated events create an `_events`
|
|
33
|
+
directory. Add any [properly formatted files](http://jekyllrb.com/docs/posts/) inside this directory just
|
|
34
|
+
like you would with posts.
|
|
35
|
+
|
|
36
|
+
## Contributing
|
|
37
|
+
|
|
38
|
+
1. Fork it
|
|
39
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
40
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
41
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
42
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'jekyll-events/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "jekyll-events"
|
|
8
|
+
spec.version = Jekyll::Events::VERSION
|
|
9
|
+
spec.authors = ["Zach Starkebaum"]
|
|
10
|
+
spec.email = ["zach@relevantwalk.com"]
|
|
11
|
+
spec.description = %q{Lets you create posts that represent future events. They're post's but in the future!}
|
|
12
|
+
spec.summary = %q{Simple event posts for Jekyll}
|
|
13
|
+
spec.homepage = ""
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_runtime_dependency 'jekyll', "> 1.2.0"
|
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
|
23
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require "jekyll-events/version"
|
|
2
|
+
|
|
3
|
+
module Jekyll
|
|
4
|
+
module Events
|
|
5
|
+
class Event < Post
|
|
6
|
+
def containing_dir(source, dir)
|
|
7
|
+
return File.join(source, dir, '_events')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def relative_path
|
|
11
|
+
File.join(@dir, '_events', @name)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class EventGenerator < Generator
|
|
16
|
+
safe true
|
|
17
|
+
|
|
18
|
+
def generate(site)
|
|
19
|
+
recursively_read_directories(site)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def recursively_read_directories(site, dir = '')
|
|
23
|
+
base = File.join(site.source, dir)
|
|
24
|
+
entries = Dir.chdir(base) { site.filter_entries(Dir.entries('.')) }
|
|
25
|
+
|
|
26
|
+
read_events(site, dir)
|
|
27
|
+
site.posts.sort!
|
|
28
|
+
|
|
29
|
+
entries.each do |f|
|
|
30
|
+
f_abs = File.join(base, f)
|
|
31
|
+
if File.directory?(f_abs)
|
|
32
|
+
f_rel = File.join(dir, f)
|
|
33
|
+
recursively_read_directories(site, f_rel) unless site.dest.sub(/\/$/, '') == f_abs
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def read_events(site, dir)
|
|
39
|
+
entries = site.get_entries(dir, '_events')
|
|
40
|
+
entries.each do |f|
|
|
41
|
+
if Post.valid?(f)
|
|
42
|
+
event = Event.new(site, site.source, dir, f)
|
|
43
|
+
if event.published && event.date >= site.time
|
|
44
|
+
site.aggregate_post_info(event)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
metadata
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-events
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Zach Starkebaum
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: jekyll
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 1.2.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 1.2.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.3'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.3'
|
|
41
|
+
description: Lets you create posts that represent future events. They're post's but
|
|
42
|
+
in the future!
|
|
43
|
+
email:
|
|
44
|
+
- zach@relevantwalk.com
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- ".gitignore"
|
|
50
|
+
- Gemfile
|
|
51
|
+
- LICENSE.txt
|
|
52
|
+
- README.md
|
|
53
|
+
- Rakefile
|
|
54
|
+
- jekyll-events.gemspec
|
|
55
|
+
- lib/jekyll-events.rb
|
|
56
|
+
- lib/jekyll-events/version.rb
|
|
57
|
+
homepage: ''
|
|
58
|
+
licenses:
|
|
59
|
+
- MIT
|
|
60
|
+
metadata: {}
|
|
61
|
+
post_install_message:
|
|
62
|
+
rdoc_options: []
|
|
63
|
+
require_paths:
|
|
64
|
+
- lib
|
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
|
+
requirements:
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
requirements: []
|
|
76
|
+
rubyforge_project:
|
|
77
|
+
rubygems_version: 2.0.3
|
|
78
|
+
signing_key:
|
|
79
|
+
specification_version: 4
|
|
80
|
+
summary: Simple event posts for Jekyll
|
|
81
|
+
test_files: []
|