|
| 1 | +# CLAUDE.md — Brainhack School Website |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +**Brainhack School** is a 4-week distributed neuroscience and open-science training event running simultaneously at multiple global sites. Participants complete structured training modules (Week 1) then work on collaborative data-science projects (Weeks 2–4). |
| 6 | + |
| 7 | +- **Live site:** https://school-brainhack.github.io |
| 8 | +- **Dev docs:** https://school-brainhack.readthedocs.io |
| 9 | +- **Stack:** Hugo static site + GitHub Pages deployment |
| 10 | +- **Theme:** `hugo-universal-theme` (Git submodule at `themes/hugo-universal-theme`) |
| 11 | +- **Hugo version:** 0.128.0 extended |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Local Development |
| 16 | + |
| 17 | +```bash |
| 18 | +# 1. Initialize submodules (required after first clone) |
| 19 | +git submodule update --init --recursive --remote |
| 20 | + |
| 21 | +# 2. Serve locally with drafts |
| 22 | +hugo serve -D |
| 23 | + |
| 24 | +# 3. Production build (run by CI) |
| 25 | +hugo --minify |
| 26 | +``` |
| 27 | + |
| 28 | +Site is served at `http://localhost:1313` by default. |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Repository Structure |
| 33 | + |
| 34 | +``` |
| 35 | +config.yaml # Main Hugo configuration |
| 36 | +content/en/ # All site content (markdown) |
| 37 | + modules/ # Training module pages (~26 modules) |
| 38 | + project/ # Student project gallery (60+ projects) |
| 39 | + sites/ # Distributed site hubs (toronto, polytechnique, criugm, singapore, taiwan) |
| 40 | + weeks/ # Schedule/week pages |
| 41 | + schedule/ # Calendar output page |
| 42 | + coc/ # Code of Conduct |
| 43 | + guide.md # Getting Started guide |
| 44 | + project_guide.md # Project submission guide |
| 45 | + register.md # Registration page |
| 46 | +data/en/ # YAML-driven dynamic content |
| 47 | + instructors.yaml # Global instructor/team list |
| 48 | + carousel/ # Homepage carousel slides (7 YAML files) |
| 49 | + testimonials/ # Quote testimonials (3 YAML files) |
| 50 | + clients/ # Sponsor/partner logos (2 YAML files) |
| 51 | + features/ # Features section (disabled; 6 YAML files) |
| 52 | +layouts/ # Custom Hugo templates (override theme) |
| 53 | + partials/ # Reusable components (nav, footer, carousel, instructors…) |
| 54 | + shortcodes/ # Custom shortcodes: gform, tabs, tab, class, content |
| 55 | + project/ # Project list + single page layouts |
| 56 | + modules/ # Module list + single page layouts |
| 57 | + sites/ # Site hub layouts |
| 58 | +static/img/ # All images |
| 59 | + logo_brainhack_2025.png |
| 60 | + carousel/ # Carousel slide images |
| 61 | + instructors/ # Instructor headshots |
| 62 | + testimonials/ # Testimonial avatars |
| 63 | + locations/ # Site hub images |
| 64 | + clients/ # Sponsor logos |
| 65 | +i18n/en.yaml # English UI strings |
| 66 | +i18n/fr.yaml # French UI strings |
| 67 | +.github/workflows/hugo.yml # CI/CD pipeline |
| 68 | +``` |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## config.yaml Key Settings |
| 73 | + |
| 74 | +| Setting | Value | Notes | |
| 75 | +|---|---|---| |
| 76 | +| `baseURL` | `https://school-brainhack.github.io` | | |
| 77 | +| `theme` | `hugo-universal-theme` | Git submodule | |
| 78 | +| `params.style` | `green` | Theme color | |
| 79 | +| `params.logo` | `img/logo_brainhack_2025.png` | Update for new year | |
| 80 | +| `params.logo_small` | `img/logo-small_2025.png` | | |
| 81 | +| `params.carousel.enable` | `true` | | |
| 82 | +| `params.instructors.enable` | `true` | | |
| 83 | +| `params.testimonials.enable` | `true` | | |
| 84 | +| `params.features.enable` | `false` | Currently disabled | |
| 85 | +| `params.recent_posts.enable` | `false` | Currently disabled | |
| 86 | +| Markdown unsafe HTML | `true` | HTML allowed in markdown | |
| 87 | + |
| 88 | +**Main menu** (by weight): Home → Projects → Schedule → Sites → Register → Modules |
| 89 | +**Dropdowns:** `documents` (Getting Started, Project Guide, CoC, Dev Docs) · `past` (2024–2018 archives) |
| 90 | +**Topbar:** GitHub, Mastodon, email contact |
| 91 | + |
| 92 | +**Custom taxonomies:** |
| 93 | +- `tags` → filter projects and modules |
| 94 | +- `names` → author/organizer names (used for filtering) |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## Content Frontmatter Reference |
| 99 | + |
| 100 | +### Project page — `content/en/project/<slug>/index.md` |
| 101 | + |
| 102 | +```yaml |
| 103 | +type: "project" |
| 104 | +date: "YYYY-MM-DD" |
| 105 | +title: "Project Title" |
| 106 | +names: [Author1, Author2] # must match instructor list if applicable |
| 107 | +github_repo: "https://github.com/..." |
| 108 | +website: "" # optional project website |
| 109 | +tags: [tag1, tag2] # LOWERCASE only |
| 110 | +summary: "~75 word description" |
| 111 | +image: "cover.png" # optional; file must exist in same directory |
| 112 | +``` |
| 113 | +
|
| 114 | +### Module page — `content/en/modules/<slug>/index.md` |
| 115 | + |
| 116 | +```yaml |
| 117 | +type: "modules" # DO NOT change this field |
| 118 | +title: "Module Title" |
| 119 | +tags: [tag1, tag2] # lowercase |
| 120 | +summary: "~75 word description" |
| 121 | +image: "cover.png" # optional |
| 122 | +``` |
| 123 | + |
| 124 | +### Site hub page — `content/en/sites/<slug>/index.md` |
| 125 | + |
| 126 | +```yaml |
| 127 | +type: "sites" |
| 128 | +date: "YYYY-MM-DD" |
| 129 | +title: "Institution Name, City, Country" |
| 130 | +names: [Organizer1, Organizer2] |
| 131 | +website: "" # optional |
| 132 | +summary: "~75 word description" |
| 133 | +image: "location.png" |
| 134 | +``` |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## Data Files — How to Update |
| 139 | + |
| 140 | +### Add or update an instructor (`data/en/instructors.yaml`) |
| 141 | + |
| 142 | +```yaml |
| 143 | +- name: Full Name |
| 144 | + gh: github_username # GitHub handle (no @) |
| 145 | + email: email@example.com |
| 146 | + website: https://... |
| 147 | + affiliation: Institution Name |
| 148 | + urlaff: https://institution-url.com |
| 149 | +``` |
| 150 | + |
| 151 | +Place headshot at `static/img/instructors/<github_username>.png` (or `.jpg`). |
| 152 | + |
| 153 | +### Update homepage carousel (`data/en/carousel/*.yaml`) |
| 154 | + |
| 155 | +```yaml |
| 156 | +weight: 0 # display order (lower = first) |
| 157 | +title: "Slide Title" |
| 158 | +description: > |
| 159 | + <ul class="list-style-none"> |
| 160 | + <li>Location</li> |
| 161 | + <li>Year</li> |
| 162 | + </ul> |
| 163 | +image: "img/carousel/filename.png" |
| 164 | +``` |
| 165 | + |
| 166 | +### Update testimonials (`data/en/testimonials/1.yaml`) |
| 167 | + |
| 168 | +```yaml |
| 169 | +text: "Quote text here" |
| 170 | +name: "Quoted Person Name" |
| 171 | +link: "https://..." |
| 172 | +avatar: "img/testimonials/avatar.jpg" |
| 173 | +``` |
| 174 | + |
| 175 | +### Update sponsors/clients (`data/en/clients/1.yaml`, `2.yaml`) |
| 176 | + |
| 177 | +```yaml |
| 178 | +title: Sponsor Name |
| 179 | +url: https://sponsor-site.com |
| 180 | +logo: img/clients/logo.png |
| 181 | +``` |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +## Custom Shortcodes |
| 186 | + |
| 187 | +| Shortcode | Usage | Purpose | |
| 188 | +|---|---|---| |
| 189 | +| `gform` | `{{< gform "FORM_ID" >}}` | Embed a Google Form | |
| 190 | +| `tabs` / `tab` | `{{< tabs >}}{{< tab name="Tab 1" >}}...{{< /tab >}}{{< /tabs >}}` | Tabbed content sections | |
| 191 | +| `class` | `{{< class "css-class-name" >}}...{{< /class >}}` | Wrap content in a CSS class | |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +## Adding New Content |
| 196 | + |
| 197 | +### New student project |
| 198 | + |
| 199 | +1. Create directory: `content/en/project/<slug>/` (use hyphens, no spaces) |
| 200 | +2. Create `index.md` with frontmatter above |
| 201 | +3. Add cover image to same directory (reference it as `image: "filename.png"`) |
| 202 | +4. Write project content in markdown — HTML is allowed |
| 203 | +5. Open a PR referencing the tracking issue: `closes #<issue-number>` |
| 204 | + |
| 205 | +### New training module |
| 206 | + |
| 207 | +1. Create `content/en/modules/<slug>/index.md` |
| 208 | +2. Set `type: "modules"` (required — do not change) |
| 209 | +3. Follow existing modules (e.g., `content/en/modules/git_github/`) as examples |
| 210 | +4. Module list layout is at `layouts/modules/list.html` |
| 211 | + |
| 212 | +### New site hub |
| 213 | + |
| 214 | +1. Create `content/en/sites/<slug>/index.md` |
| 215 | +2. Add site image to `static/img/locations/` and reference in frontmatter |
| 216 | +3. Follow `content/en/sites/toronto/` as an example |
| 217 | + |
| 218 | +### Update schedule/weeks |
| 219 | + |
| 220 | +Edit pages in `content/en/weeks/`. The schedule page at `/weeks/` also outputs an iCal calendar feed. |
| 221 | + |
| 222 | +--- |
| 223 | + |
| 224 | +## Deployment |
| 225 | + |
| 226 | +CI/CD is fully automated via `.github/workflows/hugo.yml`: |
| 227 | + |
| 228 | +- **Trigger:** push to `main` branch, or manual workflow dispatch |
| 229 | +- **Build:** Hugo 0.128.0 extended + Dart Sass, with `--minify` flag |
| 230 | +- **Deploy:** artifacts published to GitHub Pages automatically |
| 231 | + |
| 232 | +No manual deployment steps needed — merge to `main` and the site updates within ~2 minutes. |
| 233 | + |
| 234 | +--- |
| 235 | + |
| 236 | +## Key Conventions |
| 237 | + |
| 238 | +- **Tags must be lowercase** — `[machine-learning, fmri]` not `[Machine-Learning, fMRI]` |
| 239 | +- **Summaries ~75 words** — used in listing cards; too long breaks layout |
| 240 | +- **Directory names use hyphens** — `my-project/` not `my_project/` or `my project/` |
| 241 | +- **Do not change `type:` fields** in existing frontmatter — it controls which layout is used |
| 242 | +- **HTML is allowed** in markdown (Goldmark unsafe mode enabled) |
| 243 | +- **PR descriptions must reference the linked issue** — use `closes #<number>` |
| 244 | +- **Submodule must be initialized** before `hugo serve` works locally |
| 245 | +- **Instructor photos** named `<github_username>.png` in `static/img/instructors/` |
| 246 | + |
| 247 | +--- |
| 248 | + |
| 249 | +## Past Editions |
| 250 | + |
| 251 | +| Year | URL | |
| 252 | +|---|---| |
| 253 | +| 2024 | https://2024-school-brainhack.github.io/ | |
| 254 | +| 2022 | https://2022-school-brainhack.github.io/ | |
| 255 | +| 2021 | https://psy6983.brainhackmtl.org/ | |
| 256 | +| 2020 | https://school2020.brainhackmtl.org/ | |
| 257 | +| 2019 | https://brainhackmtl.github.io/school2019/ | |
| 258 | +| 2018 | https://brainhackmtl.github.io/school2018/ | |
0 commit comments