2026-02-06 19:15:21 +01:00
# Stopp lidelsen - Site built on FolderWeb
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
Advocacy site for medical cannabis patients in Norway. Built on FolderWeb (minimal file-based CMS). Decade-scale maintainability, no volatile dependencies, only essential code.
2025-11-11 23:38:18 +01:00
2026-01-14 23:15:18 +01:00
## Edit instructions
All edits to this AGENT.md file should be done in a compressed shortform for LLM consumption.
2026-02-06 19:15:21 +01:00
## Two Repos, One Site
- `app/` is a **symlink** to the FolderWeb framework (`folderweb/app` ). **NEVER modify files in `app/`.**
- Only modify files in `custom/` , `content/` , and project root.
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
- Framework docs: `../folderweb/docs/04-development/` (architecture, context API, hooks/plugins, rendering, templates, etc.)
- Site-specific docs: `docs/` in this repo.
2026-02-06 19:15:21 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
## Standards
2026-02-06 19:15:21 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
**Stack:** HTML5, PHP 8.4+, CSS. No frameworks, no build tools, no package managers.
2025-11-11 23:38:18 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
**PHP:** Arrow functions, null coalescing, match. Type hints where practical. Single-purpose functions, avoid side effects.
2025-11-11 23:38:18 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
**CSS:** Variables, native nesting, grid. `clamp()` over `@media` . Relative units. `oklch()` , `light-dark()` , logical props. Margin-top only (reset: `* { margin-bottom: 0 }` ).
**HTML/Templates:** Classless semantic HTML5. `<?= htmlspecialchars($var) ?>` for UGC. `<?= $content ?>` for pre-rendered HTML.
2025-11-11 23:38:18 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
**Security:** Path traversal protection, document root restriction, strict MIME types, escape all UGC, CSV injection prevention.
2026-02-06 19:15:21 +01:00
## Project Structure
```
content/ # Site content (folders = URLs)
custom/
config.ini # Site config (languages, plugins)
templates/ # Template overrides (base, list, page, list-card-grid, list-faq, list-grid)
styles/ # CSS overrides
plugins/page/ # Page plugins (petition-form, newsletter-signup)
languages/ # Translation files (no.ini, en.ini)
data/ # Runtime data (petition CSVs, rate limits, SMTP logs)
vendor/ # PHPMailer.Lite
app/ -> symlink # FolderWeb framework (DO NOT EDIT)
docs/ # Site-specific LLM documentation
```
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
Content: folders = URLs, numbered file prefixes control order, `cover.jpg` for list item images, `metadata.ini` controls titles/slugs/menu order/templates/feeds.
2026-02-06 19:15:21 +01:00
## Knowledge Base
2025-11-11 23:38:18 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
Read on-demand:
| Topic | File |
|---|---|
| Templates & variables | `docs/templates.md` |
| Content & metadata | `docs/content-system.md` |
| Petition system | `docs/petition-system.md` |
| Newsletter plugin | `docs/newsletter-plugin.md` |
| Framework internals | `../folderweb/docs/04-development/` |
| Test suite | `tests/README.md` | **Required before modifying `custom/` or `content/`** — workflow, how to run, how to write tests |
2025-11-11 23:38:18 +01:00
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
Site features: Norwegian (default) + English via `[en]` metadata sections. Atom feeds via `feed = true` in metadata. Petition: GDPR, CSV, double opt-in, rate limiting. Newsletter: Listmonk API, hero/small themes.
2026-01-14 23:15:18 +01:00
2026-02-06 19:15:21 +01:00
## Development Environment
2026-01-16 21:44:35 +01:00
2026-02-06 19:15:21 +01:00
Host has no PHP. Always use `podman compose` with `compose.yaml` .
2026-01-16 21:44:35 +01:00
2026-02-06 19:15:21 +01:00
**Dev server:** `localhost:4040`
Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
2026-03-17 16:43:39 +01:00
**Verification:** `curl localhost:4040/path` ; `curl -X POST -d "field=value" localhost:4040/path` for forms
**Container isolation:** ALL test data MUST stay inside container filesystem, never in mounted volumes. Use `/tmp/` or `/var/test/` .
**Running scripts:** `podman exec stopplidelsen.no php /path/to/test.php`
2026-02-06 19:15:21 +01:00
**Syntax checks:** `podman exec stopplidelsen.no php -l /var/www/custom/file.php`
**Cleanup:** `podman-compose down && podman-compose up -d` between test runs