docs(cms): update specifications for SW_FILE helper and restore system
- Renamed file() helper to sw_file() to avoid PHP conflict. - Added Restore System specification to CMS notes and specs.
This commit is contained in:
parent
d0214eb2fd
commit
42ddb5cf1a
3
NOTES.md
3
NOTES.md
|
|
@ -38,6 +38,7 @@
|
||||||
- Performance (Full-Page Caching, Image Optimization)
|
- Performance (Full-Page Caching, Image Optimization)
|
||||||
- Security (2FA, Security Audits)
|
- Security (2FA, Security Audits)
|
||||||
- Backups (Database & Files accessible via Admin and `sw site:backup`)
|
- Backups (Database & Files accessible via Admin and `sw site:backup`)
|
||||||
|
- Restore System (Restore from backup via Admin or `sw site:restore`)
|
||||||
- Settings (Site Title/Description, SEO, Configurable Blog "Home" segment)
|
- Settings (Site Title/Description, SEO, Configurable Blog "Home" segment)
|
||||||
|
|
||||||
## Architectural Decisions
|
## Architectural Decisions
|
||||||
|
|
@ -57,4 +58,4 @@
|
||||||
- **Reserved Slugs**: `loom`, `admin`, `api`, `login`, `logout`, `register`, `sw-admin`, `dashboard`.
|
- **Reserved Slugs**: `loom`, `admin`, `api`, `login`, `logout`, `register`, `sw-admin`, `dashboard`.
|
||||||
- **Multi-Tenancy**: Architecture allows for future expansion.
|
- **Multi-Tenancy**: Architecture allows for future expansion.
|
||||||
- **Unified Vite Build Pipeline**: Shared pipeline for Core and Official Plugins.
|
- **Unified Vite Build Pipeline**: Shared pipeline for Core and Official Plugins.
|
||||||
- **Asset Conflict Management**: Each Plugin/Theme uses custom root-level CSS class (e.g., `.blog`) for styles and JS.
|
- **Asset Conflict Management**: Each Plugin/Theme uses custom root-level CSS class (e.g., `.blog`) for styles and JS.
|
||||||
|
|
|
||||||
4
SPECS.md
4
SPECS.md
|
|
@ -51,10 +51,11 @@ Content is stored as a JSON array of block objects:
|
||||||
- **Helpers**:
|
- **Helpers**:
|
||||||
- `css('path', $attributes)`: Outputs a `<link>` tag.
|
- `css('path', $attributes)`: Outputs a `<link>` tag.
|
||||||
- `js('path', $attributes)`: Outputs a `<script>` tag.
|
- `js('path', $attributes)`: Outputs a `<script>` tag.
|
||||||
- `file('path', $attributes)`: **Smart Asset Helper**. Automatically detects file type (via extension/metadata) and outputs the appropriate HTML tag (`<img>` with `srcset` support, `<video>`, `<audio>`, or `<a>` for documents like PDF).
|
- `sw_file('path', $attributes)`: **Smart Asset Helper**. Automatically detects file type (via extension/metadata) and outputs the appropriate HTML tag (`<img>` with `srcset` support, `<video>`, `<audio>`, or `<a>` for documents like PDF).
|
||||||
- **JIT Image Parameters**: For images, special keys in the `$attributes` array like `w`, `h`, `fit`, `q` (quality), and `fm` (format) are automatically intercepted and passed to the JIT image generation engine.
|
- **JIT Image Parameters**: For images, special keys in the `$attributes` array like `w`, `h`, `fit`, `q` (quality), and `fm` (format) are automatically intercepted and passed to the JIT image generation engine.
|
||||||
- **Functionality**: These helpers output the **FULL HTML TAG**.
|
- **Functionality**: These helpers output the **FULL HTML TAG**.
|
||||||
- **Attributes**: The optional `$attributes` array allows for specifying `defer`, `async`, `media`, `id`, `class`, `alt`, `w`, `h`, etc.
|
- **Attributes**: The optional `$attributes` array allows for specifying `defer`, `async`, `media`, `id`, `class`, `alt`, `w`, `h`, etc.
|
||||||
|
- **Note**: `sw_file()` is used instead of `file()` to avoid conflicts with PHP's built-in `file()` function.
|
||||||
- **Recursive Search**: The engine first looks in the current Theme folder. If a Child Theme is active and the file is missing, it automatically falls back to the Parent Theme folder.
|
- **Recursive Search**: The engine first looks in the current Theme folder. If a Child Theme is active and the file is missing, it automatically falls back to the Parent Theme folder.
|
||||||
|
|
||||||
## 5. Media Manager Specification
|
## 5. Media Manager Specification
|
||||||
|
|
@ -78,3 +79,4 @@ Content is stored as a JSON array of block objects:
|
||||||
- **Full-Page Caching**: Native public-route caching.
|
- **Full-Page Caching**: Native public-route caching.
|
||||||
- **Security Audits**: Automated periodic auditing for activated plugins.
|
- **Security Audits**: Automated periodic auditing for activated plugins.
|
||||||
- **Backups**: `sw site:backup` and Admin-side trigger to snapshot the SQLite DB and project root.
|
- **Backups**: `sw site:backup` and Admin-side trigger to snapshot the SQLite DB and project root.
|
||||||
|
- **Restore**: `sw site:restore` and Admin-side UI to select and restore from existing backup files.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue