Refactor: reorganize configuration management and add default config file

This commit is contained in:
Kylian Schmidt
2026-05-08 14:05:40 +02:00
parent 6978a1b768
commit 63e4af0f9f
6 changed files with 408 additions and 233 deletions
+2 -5
View File
@@ -68,9 +68,8 @@ generate() [api.py]
| `gallery/utils/metadata.py` | Load/merge/cache YAML+JSON metadata; per-plot metadata resolution |
| `gallery/utils/stats.py` | Directory size/count statistics |
| `gallery/templates/gallery.html` | Single Jinja2 template for all gallery pages |
| `assets/js/` | Vanilla JS modules loaded as ES modules; `GalleryApp` in `gallery-app.js` orchestrates all managers |
| `assets/css/` | Modular CSS; `main.css` imports all others via `@import` |
| `generate_gallery.py` | Legacy CLI wrapper — kept for backward compatibility |
| `gallery/assets/js/` | Vanilla JS modules loaded as ES modules; `GalleryApp` in `gallery-app.js` orchestrates all managers |
| `gallery/assets/css/` | Modular CSS; `main.css` imports all others via `@import` |
| `config.yaml` | Local deployment config (paths are machine-specific) |
### Config File Format
@@ -105,8 +104,6 @@ When `source_to_update` is passed to `generate()`, only that source's subdirecto
The frontend is vanilla ES modules — no build step. `assets/js/main.js` imports `GalleryApp` from `gallery-app.js`, which instantiates all manager classes (`ThemeManager`, `SearchManager`, `NavigationManager`, etc.). Each manager is self-contained. The template embeds gallery data as JSON in the page; JS reads it at runtime.
Assets are served from `/assets/` relative to gallery pages. The Python code calculates the correct `../` depth per page when rendering the template.
### Deployment
The project ships a `Singularity.def` / `web.sif` Apptainer container for HPC environments. CI (`.gitlab-ci.yml`) builds the container and runs pytest inside it. For local development the `.venv` is sufficient.