This commit is contained in:
April John 2026-08-28 16:01:01 +02:00
commit a8450de7a8
4 changed files with 19 additions and 16 deletions

View file

@ -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'`

View file

@ -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

3
dev.sh
View file

@ -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 \

View file

@ -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