Skip to content

Instantly share code, notes, and snippets.

@woodworker
Created September 27, 2013 08:39
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woodworker/6725728 to your computer and use it in GitHub Desktop.
Save woodworker/6725728 to your computer and use it in GitHub Desktop.
a jekyll template for icalendar file
---
layout: none
---
BEGIN:VCALENDAR
VERSION:2.0
PRODID:http://www.example.com/
METHOD:PUBLISH
{% for post in site.posts limit:10 %}BEGIN:VEVENT
UID:{{ post.date | date: "%Y%m%d" }}@example.com
ORGANIZER;CN="Organizer Name":MAILTO:organizer@example.org
LOCATION:The Adress of the example
SUMMARY:{{ post.title }}
CLASS:PUBLIC
DTSTART:{{ post.date | date: "%Y%m%d" }}T170000Z
DTEND:{{ post.date | date: "%Y%m%d" }}T190000Z
DTSTAMP:{{ post.date | date: "%Y%m%d" }}T170000Z
END:VEVENT{% endfor %}
END:VCALENDAR
@shushugah
Copy link

how were you able to resolve LF to CRLF encoding errors? I tried your snippets and variants of it, but keep getting errors

@woodworker
Copy link
Author

woodworker commented Apr 25, 2020

i think layout none is now called null, try if this works for you
i use this for http://bephpug.de/calendar.ics - see https://github.com/berlinphp/berlinphp.github.com/blob/master/calendar.ics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment