jekyll-ical-tag 1.0.6 → 1.0.7
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -1
- data/lib/jekyll-ical-tag/event.rb +5 -5
- data/lib/jekyll-ical-tag/version.rb +1 -1
- data/lib/jekyll-ical-tag.rb +14 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1beec28fa33ea701a64a6ef052b8c5fe215254f8ee5a7132a859156d395205
|
4
|
+
data.tar.gz: d2f145cfdf30bb6e15be692eba8541fa0a030e5770b9acad53d037405e088c16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 462302c862fedbc0dddac6fb4b21cccaf385ee7407ed3feda606e425c95682b5cd2b1585df02b01d71575dd0882cc0a0c2018fa83522de7dc4393f034b9e5d7e
|
7
|
+
data.tar.gz: a307c6fcd3de6ac28ce920d54714646213cec7ed39c31590586f17e634bd5fc1c0bcab2943d6e6fc029844379fabf6a5351d13285f9a4e0997fe86a8997c85b5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Description: Pull ICS feed and provide a for-like loop of calendar events
|
|
8
8
|
|
9
9
|
To your Gemfile:
|
10
10
|
|
11
|
-
`gem 'jekyll-ical-tag'
|
11
|
+
`gem 'jekyll-ical-tag'`
|
12
12
|
|
13
13
|
To your `_config.yml`
|
14
14
|
|
@@ -50,3 +50,7 @@ plugins:
|
|
50
50
|
- `end_time` - end time of event
|
51
51
|
- `url` - url of event, if provided, if not, take the first url from the description.
|
52
52
|
- `attendees` - [Array] of attendees names/emails
|
53
|
+
|
54
|
+
# Special Thanks
|
55
|
+
|
56
|
+
Special thanks to the following contributors: @marchehab98 @meitar
|
@@ -17,12 +17,12 @@ module Jekyll
|
|
17
17
|
|
18
18
|
def simple_html_description
|
19
19
|
@simple_html_description ||= begin
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
description&.clone.tap do |d|
|
21
|
+
description_urls.each do |url|
|
22
|
+
d.gsub! url, %(<a href='#{url}'>#{url}</a>)
|
23
|
+
end
|
23
24
|
end
|
24
25
|
end
|
25
|
-
end
|
26
26
|
end
|
27
27
|
|
28
28
|
def attendees
|
@@ -30,7 +30,7 @@ module Jekyll
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def description_urls
|
33
|
-
@description_urls ||= description.to_s.
|
33
|
+
@description_urls ||= description.to_s.scan(URL_REGEX).to_a
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
data/lib/jekyll-ical-tag.rb
CHANGED
@@ -44,11 +44,11 @@ module Jekyll
|
|
44
44
|
context["event"] = {
|
45
45
|
"index" => index,
|
46
46
|
"uid" => event.uid.presence,
|
47
|
-
"summary" => event.summary.presence,
|
48
|
-
"description" => event.description.presence,
|
49
|
-
"simple_html_description" => event.simple_html_description.presence,
|
50
|
-
"location" => event.location.presence,
|
51
|
-
"url" => event.url&.to_s.presence || event.description_urls.first,
|
47
|
+
"summary" => as_utf8(event.summary).presence,
|
48
|
+
"description" => as_utf8(event.description).presence,
|
49
|
+
"simple_html_description" => as_utf8(event.simple_html_description).presence,
|
50
|
+
"location" => as_utf8(event.location).presence,
|
51
|
+
"url" => as_utf8(event.url&.to_s.presence || event.description_urls.first).presence,
|
52
52
|
"start_time" => event.dtstart&.to_time.presence,
|
53
53
|
"end_time" => event.dtend&.to_time.presence,
|
54
54
|
"attendees" => event.attendees,
|
@@ -80,6 +80,12 @@ module Jekyll
|
|
80
80
|
|
81
81
|
private
|
82
82
|
|
83
|
+
def as_utf8(str)
|
84
|
+
return unless str
|
85
|
+
|
86
|
+
str.force_encoding("UTF-8")
|
87
|
+
end
|
88
|
+
|
83
89
|
def scan_attributes!
|
84
90
|
@attributes = {}
|
85
91
|
@markup.scan(Liquid::TagAttributes) do |key, value|
|
@@ -101,8 +107,7 @@ module Jekyll
|
|
101
107
|
only_past = @attributes["only_past"] == "true"
|
102
108
|
|
103
109
|
raise "Set only_future OR only_past, not both" if only_future && only_past
|
104
|
-
@only =
|
105
|
-
case
|
110
|
+
@only = case
|
106
111
|
when only_future
|
107
112
|
:future
|
108
113
|
when only_past
|
@@ -113,8 +118,7 @@ module Jekyll
|
|
113
118
|
end
|
114
119
|
|
115
120
|
def set_before_date!
|
116
|
-
@before_date =
|
117
|
-
begin
|
121
|
+
@before_date = begin
|
118
122
|
if @attributes["before_date"]
|
119
123
|
Time.parse(@attributes["before_date"])
|
120
124
|
end
|
@@ -124,8 +128,7 @@ module Jekyll
|
|
124
128
|
end
|
125
129
|
|
126
130
|
def set_after_date!
|
127
|
-
@after_date =
|
128
|
-
begin
|
131
|
+
@after_date = begin
|
129
132
|
if @attributes["after_date"]
|
130
133
|
Time.parse(@attributes["after_date"])
|
131
134
|
end
|