Add Atom feed support to list pages

Introduce `feed` metadata option to enable Atom feeds
Update list item structure with standardized fields
Add `$feedUrl` template variable for autodiscovery
Improve date handling with raw/processed date separation
Document feed generation in architecture and rendering docs
Update template examples to use new item structure
This commit is contained in:
Ruben 2026-02-06 18:24:39 +01:00
parent 1cbfb67a4c
commit 069ce389ea
7 changed files with 128 additions and 48 deletions

View file

@ -76,22 +76,29 @@ router.php
├─ 3. Check custom/assets/{path} → serve static file + exit
├─ 4. Check content/{path} for static asset (css/img/pdf/font) → serve + exit
├─ 5. Empty path? → frontpage: findAllContentFiles + renderMultipleFiles
├─ 5. Path ends with feed.xml? → Atom feed generation
│ ├─ Strip feed.xml, resolve parent as list directory
│ ├─ Check feed = true in metadata, otherwise 404
│ ├─ buildListItems() + renderContentFile() for full content
│ └─ Output Atom XML + exit
└─ 6. parseRequestPath() → {type, path}
├─ 6. Empty path? → frontpage: findAllContentFiles + renderMultipleFiles
└─ 7. parseRequestPath() → {type, path}
├─ "page": trailing slash redirect → findAllContentFiles → renderMultipleFiles
│ (fires Hook::PROCESS_CONTENT for file filtering)
│ (fires Hook::TEMPLATE_VARS before template render)
│ Template chain: content → page.php → base.php
├─ "list": trailing slash redirect → build items array from subdirectories
├─ "list": trailing slash redirect → buildListItems() from helpers.php
│ ├─ Check hide_list metadata → treat as page if true
│ ├─ Select list template from metadata page_template
│ ├─ For each subdir: loadMetadata, extractTitle, extractDateFromFolder, findCoverImage
│ ├─ buildListItems(): metadata, titles, dates, covers for each subdir
│ ├─ Sort items by date (metadata `order` = ascending|descending)
│ ├─ Store pageTitle, metaDescription, feedUrl etc. on context
│ ├─ Fire Hook::TEMPLATE_VARS
│ └─ Template chain: items → list-*.php → base.php
│ └─ Template chain: items → list-*.php → base.php (via renderTemplate)
└─ "not_found": 404 response
```