Add page-specific JavaScript support

Update documentation for new JS variables and rendering pipeline

Add script.js file support to content directories

Implement cache-busting for JavaScript files

Update static file serving to include JavaScript files

Document page-specific script loading in base.php
This commit is contained in:
Ruben 2026-02-06 18:47:23 +01:00
parent f8a352afce
commit f1447049e4
6 changed files with 70 additions and 7 deletions

View file

@ -126,6 +126,12 @@ Checks extensions in `COVER_IMAGE_EXTENSIONS` order: `jpg`, `jpeg`, `png`, `webp
Returns `['url' => string, 'hash' => string]` or null. Hash is MD5 of file content for cache busting.
## Page-Specific JavaScript
**`findPageJs(string $dirPath, string $contentDir): ?array`** — Checks for `script.js` in content directory.
Returns `['url' => string, 'hash' => string]` or null. Hash is MD5 of file content for cache busting. The script is loaded with the `defer` attribute in `base.php`, placed before `</body>` for non-blocking progressive enhancement.
## Meta Description Extraction
**`extractMetaDescription(string $dirPath, ?array $metadata): ?string`**