Metadata-Version: 2.5
Name: sgelt
Version: 5.1.2
Summary: A simple static site generator for research labs
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: datetimejson>=0.1.7
Requires-Dist: icalendar==4.1.0
Requires-Dist: jinja2>=3.1
Requires-Dist: markdown-link-attr-modifier>=0.2
Requires-Dist: markdown==3.10.*
Requires-Dist: pydantic>=2.0
Requires-Dist: python-frontmatter>=1.0
Requires-Dist: pytz>=2022.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: unidecode>=1.3
Provides-Extra: demo
Requires-Dist: faker==40.43.0; extra == 'demo'
Provides-Extra: dev
Requires-Dist: faker==40.43.0; extra == 'dev'
Requires-Dist: livereload>=2.6; extra == 'dev'
Requires-Dist: pre-commit>=4.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.13.0; extra == 'dev'
Requires-Dist: ty>=0.0.1; extra == 'dev'
Description-Content-Type: text/markdown

# sgelt

A simple static site generator for research labs.

Sgelt builds a complete static website from Markdown content, Jinja2 templates,
and JSON data files. It is designed for research institutions: seminars,
conferences, defenses, team pages, news, and a searchable index.

[![coverage](https://gitlab.math.unistra.fr/irma/sgelt/badges/main/coverage.svg)](https://irma.pages.math.unistra.fr/sgelt/coverage/)

## Features

- **Markdown content** with YAML frontmatter
- **Jinja2 templates** for full layout control
- **Agenda** (seminars, conferences, defenses) with pagination by year
- **Team pages** with members and organizing seminars
- **News** with paginated indexes
- **iCal export** for seminar calendars
- **Lunr.js search index**
- **Systematic checks** (`sgelt --check`): broken links, orphan assets, duplicates
- **Dev server** with livereload (`sgelt --serve`)

## Installation

```bash
pip install sgelt
# or
uv add sgelt
```

## Quick start

```bash
mkdir mysite && cd mysite
sgelt --init        # scaffold: templates/, config.yml, content/index.md
sgelt               # build the site
sgelt --serve       # build + dev server on http://localhost:5500
```

`sgelt --init` creates a complete project structure with starter templates
bundled in the package (`sgelt/templates/`). Edit `config.yml` and
`content/index.md`, then build.

### Demo site

To see what a complete site looks like, generate one with random demo content:

```bash
mkdir mysite && cd mysite
sgelt --init --demo # scaffold + random news, teams, seminars, conferences
sgelt --serve       # preview at http://localhost:5500
```

`--demo` uses [Faker](https://faker.readthedocs.io/) to generate realistic
but entirely fictional content: news articles, team pages with members,
seminar series, conferences, and defenses (2020-2026). Requires the `demo`
extra: `pip install "sgelt[demo]"`.

A live demo is published at
[irma.pages.math.unistra.fr/sgelt](https://irma.pages.math.unistra.fr/sgelt/).

## Manual setup

Create a site project with this structure:

```
mysite/
├── config.yml          # site configuration
├── content/            # Markdown pages
│   ├── home/           # homepage cards
│   ├── teams/          # team pages
│   └── ...
├── templates/          # Jinja2 templates (copy from sgelt --init or customize)
├── static/             # CSS, JS, images
├── data/               # JSON data (agenda, teams)
│   ├── archive/        # agenda archive by year
│   └── teams.json      # team members
└── output/             # generated site (git-ignored)
```

Then build:

```bash
cd mysite
sgelt           # build the site
sgelt --check   # run checks
sgelt --serve   # build + dev server on http://localhost:5500
sgelt --clean   # remove output/
```

## Configuration (`config.yml`)

```yaml
site:
  title: "My Lab"
  url: "https://lab.example.org"
  # today: 2026-10-23  # override date for reproducible builds

nav_items:
  Home: index.html
  Team: teams/index.html
  Agenda:
    Upcoming: agenda/a_venir.html
```

## Data files

- `data/archive/<year>.json` — agenda archive (seminars, conferences, defenses)
- `data/agenda_indico.json` — optional Indico events (merged with archive)
- `data/teams.json` — team members and affiliations

See `data/*.schema.json` for the expected JSON schemas.

## Development

```bash
git clone <repo>
cd sgelt
uv sync --extra dev
uv run pytest -q
uv run ruff check
uv run ty check
```

## License

MIT
