Replace JSON config with .env files

- Add python-dotenv dependency for environment variable loading
- Replace params.json and params-local.json with .env files
- Add --local and --local-stacosys flags to makesite.py
- Update Makefile to auto-detect stacosys availability
- Document configuration and usage in README.md
This commit is contained in:
Yax 2026-01-10 16:03:08 +01:00
parent 199911aaae
commit 3b7484fbe6
9 changed files with 94 additions and 44 deletions

View file

@ -7,3 +7,38 @@ This static blog generator code is under MIT license.
"Blog du Yax" content is under [CC-BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/3.0)
## Configuration
Configuration is managed through `.env` files:
| File | Description |
|------|-------------|
| `.env` | Production configuration |
| `.env.local` | Local development (no Stacosys) |
| `.env.local-stacosys` | Local development with local Stacosys |
Environment variables:
- `TITLE` - Site title
- `SUBTITLE` - Site subtitle
- `AUTHOR` - Author name
- `SITE_URL` - Base URL for the site
- `STACOSYS_URL` - Stacosys API endpoint (optional)
- `EXTERNAL_CHECK` - Script for git change detection
## Usage
```bash
# Production build (uses .env)
uv run python makesite.py
# Local development without Stacosys (uses .env.local)
uv run python makesite.py --local
# Local development with local Stacosys (uses .env.local-stacosys)
uv run python makesite.py --local-stacosys
# Or use make for local development
make site
```