From a26b5c66c1676ee5ebbd36d4d241b8ff1ab312bb Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sat, 4 Jul 2026 20:25:20 -0500 Subject: [PATCH] docs(blog): add blog layout spec and plan --- .../plans/2026-07-04-blog-layout.md | 370 ++++++++++++++++++ .../specs/2026-07-04-blog-layout-design.md | 178 +++++++++ 2 files changed, 548 insertions(+) create mode 100644 docs/superpowers/plans/2026-07-04-blog-layout.md create mode 100644 docs/superpowers/specs/2026-07-04-blog-layout-design.md diff --git a/docs/superpowers/plans/2026-07-04-blog-layout.md b/docs/superpowers/plans/2026-07-04-blog-layout.md new file mode 100644 index 0000000..bc2c641 --- /dev/null +++ b/docs/superpowers/plans/2026-07-04-blog-layout.md @@ -0,0 +1,370 @@ +# Blog Index Layout Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Build the blog index layout shown in `blog-mockup.png` so `/blog/` and any other view using `index.php` render a "Blog" page title, a grid of post cards (image + title + byline), and the existing sidebar. + +**Architecture:** A small refactor of `index.php` (add a page title, trim the post card) and an unfreeze of `styles/components/post-list.css` (add `.post-list__h1` styles). A new Playwright test verifies the result. The existing sidebar logic, pagination, and post grid layout are preserved. + +**Tech Stack:** WordPress 6.x, PHP 8.x, Tailwind CSS v4, Playwright, axe-core, PHPCS (WordPress standard). + +## Global Constraints + +- Tabs for PHP indentation (project standard, see `composer.json` and existing files). The brief's canonical PHP for the index.php changes should use tabs. +- The theme's Tailwind build outputs `static/dist/theme.css`; that file is gitignored but committed with `git add -f` per project convention. +- PHPCS uses the WordPress coding standard; `composer lint` must pass. Note: the previous contact-page work surfaced 5 pre-existing PHPCS CRLF errors on untouched files — they are out of scope and not introduced by this plan. +- All Playwright tests in `tests/*.spec.js` must pass except the 4 pre-existing `mobile-homepage.spec.js` failures (out of scope) and the still-broken services-hero-scope ACF data state (separate user follow-up). +- The new `index.php` change applies to all views that route through it: `/blog/`, category archives, tag archives, author archives, and search results. No new template files are created. +- The post card content is simplified to image + title + byline (no categories, no excerpt). The card's `px-4 py-8` padding is tightened to `px-4 py-6`. +- The page title is hard-coded "Blog" (project's standard H1 styling: Quincy serif, CWC Blue 01, fluid `--h1` size, 700 weight). The title is the same on every view that uses `index.php`. +- The hero gate (set in the previous turn: `$showHero = isServicesDescendant() && get_field( 'hero_style' ) === 'default'`) is unaffected. + +--- + +## File Structure + +| File | Responsibility | Created/Modified | +| --- | --- | --- | +| `index.php` | Renders the blog index, category/tag/author archives, and search results. Add a "Blog" H1 and trim the post card. | Modify | +| `styles/components/post-list.css` | Unfreeze the file and add `.post-list__h1` styles. | Modify | +| `tests/blog-page.spec.js` | New Playwright spec for the blog layout. | Create | +| `static/dist/theme.css` | Rebuilt via `npm run build`. | Modified (committed with `git add -f`). | + +--- + +### Task 1: Update `index.php` — add page title, trim the post card + +**Files:** +- Modify: `index.php` + +**Interfaces:** +- Consumes: the standard WordPress loop (`have_posts()`, `the_post()`). +- Produces: a `
` with the existing sidebar-aware grid; a `

Blog

` at the top of the post list; a card per post with image, title link, and byline (no categories, no excerpt). + +- [ ] **Step 1: Read `index.php` to confirm the current structure** + +The file has been read in this session (it currently renders `.post-list__posts` with cards containing categories, title, excerpt, and byline). Confirm the line numbers and class names match the spec. + +- [ ] **Step 2: Add the H1 and trim the card** + +Replace the post-list opening + card inner content with the new structure: + +```php + +
+
+

Blog

+ +
+ +
+
+ + + + <?php echo esc_attr( $imgAlt ); ?> + +
+ +
+ +

+
+ + +
+
+ +
+ +
+ 2, + 'prev_text' => '« Previous', + 'next_text' => 'Next »', + ) + ); + ?> +
+
+
+ +
+
+

Nothing here yet…

+

No published posts found.

+
+
+ +``` + +Specifically: +- Add `

Blog

` after the `
` opening tag. +- Remove the `
` block. +- Remove the `
` block. +- Change `post-list__details px-4 py-8` to `post-list__details px-4 py-6`. +- Do NOT touch the `