CorrelAid / correlaid_website

Source code for the CorrelAid website
https://correlaid.org
3 stars 0 forks source link

Feature: Add Ical link to follow events and RSS to subscribe to blog posts #487

Closed tifa365 closed 10 months ago

tifa365 commented 10 months ago

https://www.correlaid.org/en/events https://www.correlaid.org/en/blog/

KonradUdoHannes commented 10 months ago

I think we should probably split this into two feature requests. Also on the technical side there is quite a difference between creating iCalender files and offer them for download and RSS. For RSS I think we would need to both create the files and provide a feed through wich they are obtained.

KonradUdoHannes commented 10 months ago

I had a more of a look into the topics in general, and I think our current deployment process is actually well suited to integrate calendar feeds and rss feeds. If we create the corresponding (asset) files for the calendars and rss during the build step we can integrate it in the website and its automatically updated once a day. We might need to set up a little more on the directus side (such as uuids for calendar events) but that should work as well.

On the sveltekit side we would probably be able to serve the non-html files using svelte-kits API routes, but we'll have to check that this creates a proper static build

KonradUdoHannes commented 10 months ago

I checked the the proposed API route solution for static builds and it it works with svelte-kit. So routes such as .../someCalendar.ics can be defined with +server.js files of the form given below. I just pasted the content of an open calendar into the constant CAL for testing, but one can also define it dynamically.

RSS feeds should work the same just with the content type being replaced by xml.

export const prerender = true;

export function GET() {

  return new Response(CAL, {
    headers: {
      'Content-Type': "text/calendar; charset=utf-8",
    }
  });
}

This means we can proceed with case specific discussions and technical implementations.

Issue for calendar(s): #493 Issue for RSS: #494

jstet commented 3 months ago

@tifa365 rss feed is implemented now :)

jstet commented 3 months ago

ical link as well