jekyll-ical-tag 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/jekyll-ical-tag/version.rb +1 -1
- data/lib/jekyll-ical-tag.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d234777e1efb40a2d7a4d2c3ece936a21a9b22521f691db615cbefa693e94f9
|
4
|
+
data.tar.gz: 27ec683fdeb6598ccc15604e3426e101efc94d210dd030d075a1fb90bf907853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47e65509012af13fe385cbdba02675819d1ba82ff361e9be6aa23dd26f587f9b17a13b8e2d5f82c5b08bbf8e0cf0cc6a348a9039e6e3c3f199bebadee6bb3444
|
7
|
+
data.tar.gz: 8efcb4b61f6589721b242595b855992478985ec57b3915da68d5e9c09056991066039ed22485b8ac1b35f9469a2598aacc97e45e6929b723331064646ce4a1ed
|
data/README.md
CHANGED
@@ -39,6 +39,7 @@ plugins:
|
|
39
39
|
|
40
40
|
- `before_date` - limits returned events to dates before a specific date. This gets parsed with Ruby's Time.parse (e.g. 01-01-2018)
|
41
41
|
- `after_date` - limits returned events to dates before a specific date. This gets parsed with Ruby's Time.parse (e.g. 01-01-2018).
|
42
|
+
- `limit` - limits the number of returned events to the first N events matching the specified criteria. For example, `{% ical url: https://example.com/events.ics only_future:true limit:5 %}` returns the first five future events.
|
42
43
|
|
43
44
|
## Event Attributes:
|
44
45
|
|
data/lib/jekyll-ical-tag.rb
CHANGED
@@ -18,6 +18,7 @@ module Jekyll
|
|
18
18
|
@markup = markup
|
19
19
|
|
20
20
|
scan_attributes!
|
21
|
+
set_limit!
|
21
22
|
set_reverse!
|
22
23
|
set_url!
|
23
24
|
set_only!
|
@@ -37,6 +38,9 @@ module Jekyll
|
|
37
38
|
parser = CalendarLimiter.new(parser, after_date: @after_date)
|
38
39
|
|
39
40
|
events = parser.events
|
41
|
+
if @limit
|
42
|
+
events = events.first(@limit)
|
43
|
+
end
|
40
44
|
length = events.length
|
41
45
|
|
42
46
|
context.stack do
|
@@ -93,6 +97,14 @@ module Jekyll
|
|
93
97
|
end
|
94
98
|
end
|
95
99
|
|
100
|
+
def set_limit!
|
101
|
+
if @attributes["limit"]
|
102
|
+
@limit = @attributes["limit"].to_i
|
103
|
+
else
|
104
|
+
@limit = nil
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
96
108
|
def set_reverse!
|
97
109
|
@reverse = @attributes["order"] == "reverse"
|
98
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-ical-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricky Chilcott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|