diff --git a/README.md b/README.md index 7c3d36d..8f6814c 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,30 @@ This is the website of the CCCB. Every change you make on the project will be reflected in your browser as long as `hugo serve` is running. -The *"Nächste Veranstaltungen"* calendar on the home page is rendered by -Hugo via the `calendar` shortcode, which fetches `all.ics` client-side. -`all.ics` is generated from the individual event pages by `./tools/merge_cals.py`. -To preview the fully-built site (including `all.ics`), or to ready the site for -upload, run: +The *"Nächste Veranstaltungen"* table on the home page and the calendar under `/verein/calendar/` are rendered in the +browser by `assets/js/upcoming.js` and `assets/js/calendar.js`. Both fetch `/calendars/all.ics`, which is **not** +generated by Hugo and is not part of this repo — it is published separately on the web server. Without it both tables +stay empty. Download the published calendar into `static/`, which Hugo serves under the same path, and they work +locally, under `hugo serve` as well as in a built site: + +```shell +mkdir -p static/calendars +curl -o static/calendars/all.ics https://berlin.ccc.de/calendars/all.ics +``` + +The file is only there to look at the site, it is not checked in. Download it again whenever you want the events that +are currently published. + +Hugo does generate an `.ics` feed per section (for example `/veranstaltungen/index.ics`) from the `dtstart`, `dtend` +and `rrule` front matter of the pages in `content/veranstaltungen/`, using the `.ics` templates under `layouts/`. + +To build the site for upload, run: ```shell ./build.sh ``` -`build.sh` runs `hugo`, generates `all.ics`, and copies it into `public/`. -It depends on Python with the `icalendar`, `python-dateutil`, and `pytz` -packages. Inside `nix develop` these are provided automatically. +This deletes `public/` and runs `hugo` with the parameters from `.hugo-params`. To build with *nix*: `nix build '.?submodules=1#production-content'` diff --git a/build.sh b/build.sh index d2b3eb3..625a262 100755 --- a/build.sh +++ b/build.sh @@ -5,5 +5,3 @@ set -ex rm -rf public/ # delete old generated files hugo $(cat .hugo-params) -./tools/merge_cals.py -cp static/all.ics public/all.ics diff --git a/dev.sh b/dev.sh index 9cbb013..2db7841 100755 --- a/dev.sh +++ b/dev.sh @@ -2,9 +2,6 @@ set -e -# Regenerate the merged calendar so the JS calendar widget has fresh data -./tools/merge_cals.py 2>/dev/null || echo "Note: merge_cals.py skipped (no public/ dir yet)" - hugo server \ --buildDrafts \ --buildFuture \ diff --git a/flake.nix b/flake.nix index 386f9db..c29b73a 100644 --- a/flake.nix +++ b/flake.nix @@ -58,9 +58,6 @@ buildPhase = '' mkdir -p public hugo --baseURL=https://${domain}/ - - python3 ./tools/merge_cals.py - cp static/all.ics public/all.ics ''; # Install phase - copy the public directory to the output