Skip to content

Commit 56bee3f

Browse files
committed
fix: ics description length
1 parent eb504c7 commit 56bee3f

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

_layouts/calendar-conferences.ics

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ORGANIZER:pythondeadlin.es
1010
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
1111
DTSTART;VALUE=DATE:{{ conf.start | date: "%Y%m%d"}}
1212
DTEND;VALUE=DATE:{{ conf.end | date: "%Y%m%d"}}
13-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
13+
{%- capture desc -%}<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.{%- endcapture -%}
14+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
1415
LOCATION:{{ conf.place }}
1516
ORGANIZER:pythondeadlin.es
1617
END:VEVENT{% endfor %}

_layouts/calendar-deadlines.ics

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ VERSION:2.0
44
PRODID:-//{{ site.url }}//{{ site.github_repo }}//EN
55
X-PUBLISHED-TTL:PT1H{% for conf in site.data.conferences %}
66
{%- if conf.cfp_ext -%}{%- assign cfp = conf.cfp_ext -%}{%- assign extended = "(extended)" -%}{%- else -%}{%- assign cfp = conf.cfp -%}{%- endif -%}
7+
{%- capture desc -%}<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.{%- endcapture -%}
78
{% if conf.workshop_deadline and conf.workshop_deadline != "TBA" %}
89
BEGIN:VEVENT
910
SUMMARY:{{ conf.conference }} {{ conf.year }} Workshop Deadline
1011
UID:{{conf.conference | slugify: "latin"}}-{{conf.year}}-workshop {%- if conf.timezone contains "UTC" -%} {%- assign tz = conf.timezone | split: "UTC" -%} {%- if tz[1] contains "-" -%} {%- assign tz = tz[1] | replace: "-", "+" -%} {%- else if tz[1] contains "+" -%} {%- assign tz = tz[1] | replace: "+", "-" -%} {%- else assign tz = tz[1] -%} {%- endif -%}
1112
ORGANIZER:pythondeadlin.es
12-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
13+
{%- capture desc -%}<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.{%- endcapture -%}
14+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
1315
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
1416
DTSTART;TZID=Etc/GMT{{ tz }}:{{ conf.workshop_deadline | date: "%Y%m%dT%H%M%S" }}
1517
{% else %}
1618
ORGANIZER:pythondeadlin.es
17-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
19+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
1820
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
1921
DTSTART;TZID={{ conf.timezone }}:{{ conf.workshop_deadline | date: "%Y%m%dT%H%M%S" }}
2022
{% endif %}END:VEVENT
@@ -24,12 +26,12 @@ BEGIN:VEVENT
2426
SUMMARY:{{ conf.conference }} {{ conf.year }} Tutorial Deadline
2527
UID:{{conf.conference | slugify: "latin"}}-{{conf.year}}-tutorial {%- if conf.timezone contains "UTC" -%} {%- assign tz = conf.timezone | split: "UTC" -%} {%- if tz[1] contains "-" -%} {%- assign tz = tz[1] | replace: "-", "+" -%} {%- else if tz[1] contains "+" -%} {%- assign tz = tz[1] | replace: "+", "-" -%} {%- else assign tz = tz[1] -%} {%- endif -%}
2628
ORGANIZER:pythondeadlin.es
27-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
29+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
2830
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
2931
DTSTART;TZID=Etc/GMT{{ tz }}:{{ conf.tutorial_deadline | date: "%Y%m%dT%H%M%S" }}
3032
{% else %}
3133
ORGANIZER:pythondeadlin.es
32-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
34+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
3335
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
3436
DTSTART;TZID={{ conf.timezone }}:{{ conf.tutorial_deadline | date: "%Y%m%dT%H%M%S" }}
3537
{% endif %}END:VEVENT
@@ -39,12 +41,12 @@ BEGIN:VEVENT
3941
SUMMARY:{{ conf.conference }} {{ conf.year }} Deadline {{ extended }}
4042
UID:{{conf.conference | slugify: "latin"}}-{{conf.year}} {%- if conf.timezone contains "UTC" -%} {%- assign tz = conf.timezone | split: "UTC" -%} {%- if tz[1] contains "-" -%} {%- assign tz = tz[1] | replace: "-", "+" -%} {%- else if tz[1] contains "+" -%} {%- assign tz = tz[1] | replace: "+", "-" -%} {%- else assign tz = tz[1] -%} {%- endif -%}
4143
ORGANIZER:pythondeadlin.es
42-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
44+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
4345
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
4446
DTSTART;TZID=Etc/GMT{{ tz }}:{{ cfp | date: "%Y%m%dT%H%M%S" }}
4547
{% else %}
4648
ORGANIZER:pythondeadlin.es
47-
DESCRIPTION:<a href="{{conf.link}}">{{ conf.conference }} {{ conf.year }}</a> found on <a href="https://pythondeadlin.es">PythonDeadlin.es</a>.
49+
{{ desc | prepend: "DESCRIPTION:" | normalize_whitespace | wrap_lines }}
4850
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
4951
DTSTART;TZID={{ conf.timezone }}:{{ cfp | date: "%Y%m%dT%H%M%S" }}
5052
{% endif %}END:VEVENT
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Jekyll
2+
module WrapLinesFilter
3+
def wrap_lines(input_string)
4+
max_length = 72
5+
wrapped_string = ""
6+
7+
while input_string.length > max_length
8+
line = input_string.slice!(0, max_length)
9+
line += "\r\n "
10+
wrapped_string += line
11+
end
12+
13+
wrapped_string += input_string
14+
15+
wrapped_string
16+
17+
end
18+
end
19+
end
20+
21+
Liquid::Template.register_filter(Jekyll::WrapLinesFilter)

0 commit comments

Comments
 (0)