Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 81 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
# Publishing the SIMLab Website
# SIMLab Website

The website at [simlab-vs.github.io](https://simlab-vs.github.io) is generated from
two plain-text Markdown files and a Python build script. No build tools, no
dependencies, no framework.
The website at [simlab-vs.github.io](https://simlab-vs.github.io) showcases SIMLab's
research projects and team. It is built from plain Markdown files — no web skills needed
to keep it up to date.

## What you can do

- **Add or update a project** — edit a file in `data/projects/`
- **Add or update a team member** — edit a file in `data/team/`
- **Change the site layout or style** — edit `index.html` and `build.py`

All content lives in the `data/` directory as simple text files. If you can write an
email, you can edit this website.

## How it works

```
data/projects.md ─┐
data/collaborators.md ─┤──► build.py ──► index.html ──► GitHub Pages
index.html (template) ─┘
data/projects/*.md ─┐
data/team/*.md ─┤──► build.py ──► index.html ──► GitHub Pages
index.html ─┘
```

`build.py` parses the Markdown files and injects the generated HTML between
marker comments in `index.html`. GitHub Pages then serves `index.html` directly
from the `main` branch.
`build.py` parses the Markdown files and injects the generated HTML into `index.html`.
GitHub Pages then serves `index.html` directly from the `main` branch.

---

## Editing content

### Projects — `data/projects.md`
### Projects — `data/projects/`

Each project is a `## Heading` block followed by optional `key: value` fields
and a free-form description paragraph:
Each file in `data/projects/` describes one project. Create a new `.md` file or edit an
existing one. The format is a `## Title` heading, optional `key: value` fields, and a
free-form description:

```markdown
## Project Title
funding: Horizon # Horizon | SNSF | Innosuisse | HES-SO (or any string)
period: 2024–2027
partners: EPFL, WSL
website: https://example.com
github: https://github.com/simlab-vs/my-project
status: ongoing # ongoing | completed

Expand All @@ -37,29 +49,65 @@ the script joins them into a single paragraph.

All fields are optional. Only the `## Title` is required.

### Collaborators — `data/collaborators.md`
**Funding badge colours**

| Value | Badge colour |
|------------|-------------|
| Horizon | Blue |
| SNSF | Green |
| Innosuisse | Amber |
| HES-SO | Purple |
| other | Grey |

---

### Team members — `data/team/`

Each file in `data/team/` describes one person. Name files with a numeric prefix to
control the display order (e.g. `01-jane-doe.md`):

```markdown
## Full Name
title: Associate Professor
affiliation: EPFL
role: Director
title: Prof. Dr.
affiliation: HES-SO
website: https://example.com
email: name@example.com # optional, not displayed publicly
email: name@example.com # used for Gravatar avatar, not shown publicly
interests: Machine Learning, Control Systems

One or two sentences of bio.
```

### Funding badge colours
The `email` field drives the profile photo via [Gravatar](https://gravatar.com). If no
email is set, a placeholder avatar is shown.

| Value | Badge colour |
|------------|-------------|
| Horizon | Blue |
| SNSF | Green |
| Innosuisse | Amber |
| HES-SO | Purple |
| other | Grey |
---

## Publishing your changes

You don't need to build anything locally. Just edit the files, open a pull request, and
CI will rebuild `index.html` automatically.

**Step-by-step:**

1. Edit or create files under `data/`.
2. Commit and push your branch.
3. Open a pull request — CI rebuilds `index.html` and commits it to your branch.
4. Merge once the preview looks good.

```bash
# Example: add yourself to the team
git checkout -b add-jane-doe
# … edit data/team/08-jane-doe.md …
git add data/team/08-jane-doe.md
git commit -m "feat(team): add Jane Doe"
git push origin add-jane-doe
# then open a pull request on GitHub
```

---

## Rebuilding locally
## Rebuilding locally (optional)

Requires [uv](https://docs.astral.sh/uv/). No other dependencies.

Expand All @@ -70,37 +118,17 @@ uv sync
# Rebuild index.html in-place
uv run build.py

# Preview generated HTML without touching index.html
# Preview without touching index.html
uv run build.py --check

# Use a different data directory or output file
uv run build.py --data path/to/data --output path/to/index.html
```

## Publishing

All changes go through a pull request. CI automatically rebuilds `index.html`
and commits it to your PR branch — no local build step required.

**Workflow for contributors:**

1. Edit files under `data/` (or `build.py`).
2. Commit and push your changes.
3. Open a pull request — CI will regenerate `index.html` and push a
`chore: rebuild index.html` commit to your branch automatically.

```bash
git add data/team/your-name.md
git commit -m "feat(team): update your-name profile"
git push origin your-branch
```
---

## Adding a new section to the site

1. Create `data/mysection.md` with the same `## heading` + fields + body format.
2. Add `<!-- BEGIN:mysection -->` / `<!-- END:mysection -->` markers in
`index.html` where the section should appear.
1. Create a `data/mysection/` directory with `.md` files using the same format.
2. Add `<!-- BEGIN:mysection -->` / `<!-- END:mysection -->` markers in `index.html`.
3. Add CSS for the new section directly in `index.html`.
4. Add a `parse_mysection` / `render_mysection` / `build_mysection_html`
function trio in `build.py` following the existing pattern, and call
`inject(text, "mysection", ...)` in `main()`.
4. Add a `parse_mysection` / `render_mysection` / `build_mysection_html` function trio
in `build.py` following the existing pattern, and call `inject(text, "mysection", …)`
in `main()`.
1 change: 1 addition & 0 deletions data/team/01-gregory-mermoud.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Gregory Mermoud
role: Director
title: Prof. Dr.
email: gregory.mermoud@hevs.ch
website: https://gregorymermoud.ch
interests: Hybrid Modeling, Differential Programming, Uncertainty Quantification, Dynamical Systems

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ <h3>TrunX – Domain-Informed Tree Growth and Mortality Modelling</h3>
<h2>Team</h2>
<div class="collab-grid">
<div class="collab-card">
<div class="collab-avatar">GM</div>
<img class="collab-photo" src="https://www.gravatar.com/avatar/1404483460349bbf8ed2f55cfcee2c64?s=200&d=mp" alt="GM" />
<div class="collab-body">
<h3><a href="https://gregorymermoud.ch" target="_blank" rel="noopener">Prof. Dr. Gregory Mermoud</a></h3>
<div class="collab-interests"><span class="interest-tag">Hybrid Modeling</span><span class="interest-tag">Differential Programming</span><span class="interest-tag">Uncertainty Quantification</span><span class="interest-tag">Dynamical Systems</span></div>
Expand Down
Loading