How to fetch an ICS(iCalendar) response and show it in Jekyll

This is ICS link: https://www.openmainframeproject.org/events/category/zowe?ical=1&tribe_display=photo

I’m new using Jekyll, I need to fetch the response and parse it into YAML or would like to directly show it to the webpage, how should it be done?

The response is shown in similar format
image

2 Likes

Jekyll itself doesn’t directly support the fetching and parsing of vObject/vFormat data, like vCalendar .ics files. Some options could be:

  • Use a script to download and convert vCalendar objects and then run Jekyll
  • Use or write a Jekyll plugin, to parse (and possibly download) vCalendar objects.

There are some Ruby Gems for processing vObject/vFomat that might be useful:

3 Likes

Thank you so much !!

Indeed you could have a script that runs before Jekyll build that converts a folder of calendar files into another folder of YAML files.

bin/convert_ical.sh && bundle exec jekyll build 

The script could be shell or Ruby or Python or whatever, it would just have to instead inside the repo.

Once it is in YAML format, it is easy to read and iterate over as Data files

Or you could even output them as .md files in a collection folder - they don’t have to get built as HTML output but you can access as a collection.


Or use a Ruby plugin, which means you could install the gems listed above and add your logic on top.

If you find or write a Ruby plugin, then the conversion step will happen within Jekyll build, rather than before it. Also a plugin could be either a single Ruby script in the repo _plugins folder, or it gets installed from a GitHub or RubyGems URL URL means other people can install it to.

Either way, you can’t run on GH Pages with this custom flow. Unless you use GH Actions. Or use Netlify instead.

2 Likes