|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is the [civictech.ca](https://civictech.ca) website — a Jekyll 4 static site for Civic Tech Toronto, hosted on GitHub Pages. |
| 8 | + |
| 9 | +## Development Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +# Install Ruby dependencies |
| 13 | +make install # or: bundle install |
| 14 | + |
| 15 | +# Start development server |
| 16 | +make serve # http://localhost:4000 |
| 17 | +make serve-incremental # faster rebuilds |
| 18 | + |
| 19 | +# Regenerate tag/category data and pages (required after content changes) |
| 20 | +make generate |
| 21 | + |
| 22 | +# Update archives submodule to latest |
| 23 | +make update # or: git submodule update --remote --merge |
| 24 | + |
| 25 | +# Clean build artifacts |
| 26 | +make clean |
| 27 | +``` |
| 28 | + |
| 29 | +The `make generate` step must be run before serving if you've changed content in the `archives/` submodule, as it runs four shell scripts that extract tags and categories from front matter and write them to `_data/` and `tags/`/`categories/` directories. |
| 30 | + |
| 31 | +## Architecture |
| 32 | + |
| 33 | +### Content Lives in a Git Submodule |
| 34 | + |
| 35 | +All actual content (meetups, projects, people, organizations, venues, resources) lives in the `archives/` submodule — a separate repository updated daily by CI. The main repo contains only templates, styles, scripts, and site configuration. When working with content, always remember to initialize submodules: |
| 36 | + |
| 37 | +```bash |
| 38 | +git submodule update --init --recursive |
| 39 | +``` |
| 40 | + |
| 41 | +### Jekyll Collections |
| 42 | + |
| 43 | +Defined in `_config.yml`, collections map to these URL paths: |
| 44 | +- `archives/_meetups/` → `/events/` |
| 45 | +- `archives/_projects/` → `/projects/` |
| 46 | +- `archives/_people/` → `/people/` |
| 47 | +- `archives/_organizations/` → `/organizations/` |
| 48 | +- `archives/_venues/` → `/venues/` |
| 49 | +- `archives/_resources/` → `/resources/` |
| 50 | +- `_announcements/` → `/announcements/` |
| 51 | + |
| 52 | +### Data Generation Pipeline |
| 53 | + |
| 54 | +Tags and categories are not manually maintained — they're generated from collection front matter by bash scripts in `_scripts/`: |
| 55 | + |
| 56 | +1. `generate_tag_data.sh` → writes `_data/tags.yml` |
| 57 | +2. `generate_tag_pages.sh` → writes `tags/*.html` |
| 58 | +3. `generate_category_data.sh` → writes `_data/categories.yml` |
| 59 | +4. `generate_category_pages.sh` → writes `categories/*.html` |
| 60 | + |
| 61 | +The CI build (`.github/workflows/pages.yml`) always runs `make generate` before `jekyll build`. Do not manually edit files in `tags/`, `categories/`, or `_data/tags.yml`/`_data/categories.yml` — they will be overwritten. |
| 62 | + |
| 63 | +### Navigation and Site Data |
| 64 | + |
| 65 | +Site-wide data is in `_data/`: |
| 66 | +- `navigation.yml` — header/footer nav structure |
| 67 | +- `footer_social.yml` — social links with `rel` attribute support (used for Mastodon verification) |
| 68 | +- `featured_topics.yml` — homepage featured topics |
| 69 | + |
| 70 | +### Image Handling |
| 71 | + |
| 72 | +The `jekyll_picture_tag` plugin processes images from `archives/images/` and caches generated thumbnails in `assets/thumbs/`. This requires `libvips` and `imagemagick` to be installed locally. The `assets/thumbs/` directory is gitignored and regenerated at build time. |
| 73 | + |
| 74 | +## CI/CD |
| 75 | + |
| 76 | +- **`pages.yml`**: Triggers on push to `main`. Runs `make generate`, then `jekyll build`, then deploys to GitHub Pages. |
| 77 | +- **`update-submodule.yml`**: Runs daily at midnight UTC, creates a PR to bump the `archives` submodule to its latest master commit. |
| 78 | + |
| 79 | +## Ruby Version |
| 80 | + |
| 81 | +The project requires Ruby 3.2.2 (specified in `.ruby-version`). Use `rbenv` or `rvm` to manage this. |
0 commit comments