docs: block directories need explicit registration, not just files

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
chrnxandClaude Opus 5 committed 2026-08-15 14:07:58 -05:00
1 parent 6fc35bafd8
commit 69c57ea73c
1 file changed
+8
@@ -405,8 +405,11 @@ git commit -m "feat: add shared placeholder art for projects without a cover"
**Files:**
- Create: `blocks/project-list/block.json`, `blocks/project-list/render.php`
- Modify: `inc/blocks.php:235` — add `'project-list'` to the `$blocks` array
- Test: `tests/php/ProjectBlocksTest.php` (create)
**Registration is not automatic.** `chrnx_register_editorial_blocks()` iterates an explicit allowlist array and only then calls `register_block_type()` on the matching directory. Creating `blocks/project-list/` without adding its name to that array leaves the block unregistered, and `do_blocks()` returns the raw comment, so the test fails with no useful message.
**Interfaces:**
- Consumes: `chrnx_get_project_links()`, `chrnx_get_heading_level()`, `chrnx_get_topic_portrait_markup()`, `chrnx_get_platform_links_markup()`.
@@ -499,6 +502,10 @@ Expected: FAIL. `do_blocks()` returns the unrendered comment because `chrnx/proj
}
```
- [ ] **Step 3b: Register the block**
Add `'project-list'` to the `$blocks` array in `chrnx_register_editorial_blocks()` at `inc/blocks.php:235`, keeping the existing single-line array format.
- [ ] **Step 4: Create `blocks/project-list/render.php`**
```php
@@ -575,6 +582,7 @@ git commit -m "feat: list every project with its status and links"
**Files:**
- Create: `blocks/project-detail/block.json`, `blocks/project-detail/render.php`
- Modify: `inc/blocks.php:235` — add `'project-detail'` to the `$blocks` array, exactly as Task 4 added `'project-list'`
- Test: `tests/php/ProjectBlocksTest.php` (extend)
**Interfaces:**