Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
535d290
Migrate theme to Full Site Editing architecture
pfefferle Oct 25, 2025
7d41194
Refine FSE theme design: comments, typography, post formats, CSS cleanup
pfefferle Feb 27, 2026
234a604
Add aside and video post format templates with supporting CSS and PHP
pfefferle Feb 27, 2026
d46d37b
Fix header alignment, byline wrapping, floats, and video-hero editor …
pfefferle Feb 27, 2026
fffa2a1
Use generic child selector for site logo instead of targeting svg
pfefferle Feb 27, 2026
ad3d49a
Fix header gap, byline, and version bump to 2.0.1
pfefferle Feb 27, 2026
a69f424
Fix byline layout: use inline display instead of broken flex
pfefferle Feb 27, 2026
a14a14e
Only extract video-hero from block-editor posts
pfefferle Feb 27, 2026
5993c2f
Fix float alignment in FSE constrained layouts
pfefferle Feb 27, 2026
1cf0280
Remove hardcoded fallback from float alignment margins
pfefferle Feb 27, 2026
9641768
Fix video-hero embed overflow and responsive sizing
pfefferle Feb 27, 2026
189a8b4
Fix video-hero embed overflow and responsive sizing
pfefferle Feb 27, 2026
7bb707e
Constrain embed iframes to parent width
pfefferle Feb 27, 2026
999bc3e
Remove height:auto from embed iframes
pfefferle Feb 27, 2026
73d0dc3
Bump version to 2.0.2 for cache busting
pfefferle Feb 27, 2026
e5c43db
Remove embed sizing hacks, use default content width
pfefferle Feb 27, 2026
2a75b0e
Strip embed alignment on archive pages via render_block filter
pfefferle Feb 27, 2026
4d7171b
Use generic render_block filter for embed alignment stripping
pfefferle Feb 27, 2026
520c038
Remove alignment and embed hacks, let WordPress core handle it
pfefferle Feb 27, 2026
8cda75e
Fix video-hero: contain absolute-positioned embed children
pfefferle Feb 27, 2026
43425cd
Fix video-hero: use aspect-ratio to ensure proper height for embeds
pfefferle Feb 27, 2026
78135d4
Fix semantic regressions and refactor block metadata handling
pfefferle Feb 27, 2026
ec62f3c
Deduplicate semantic classes in body and block filters
pfefferle Feb 27, 2026
9acbb50
Remove duplicate h-feed class from query wrapper
pfefferle Feb 27, 2026
fdc5cd2
Move singular h-entry semantics to body only
pfefferle Feb 27, 2026
236997a
Map legacy semantics logic to block-based filters
pfefferle Feb 27, 2026
0062fa2
Scope h-entry to body on singular and post articles on archives
pfefferle Feb 27, 2026
743b65e
Prevent nested h-entry on singular article wrappers
pfefferle Feb 27, 2026
a48d105
Normalize search UI and align quote/image spacing
pfefferle Mar 1, 2026
cdc9f29
Keep menu aligned with title and refine mobile flyout
pfefferle Mar 1, 2026
810dff7
Unify archive templates and move nav sizing to theme vars
pfefferle Mar 1, 2026
f6899c3
Use block metadata for post-format and simplify header CSS
pfefferle Mar 1, 2026
3f98c0e
Refine post meta consistency and simplify theme styling
pfefferle Mar 1, 2026
c2b61ac
Refine archive/search layout and unify meta typography
pfefferle Mar 1, 2026
1253c38
Semantics: restore itemref and reuse site branding publisher
pfefferle Mar 1, 2026
852abe2
Semantics: add logo meta URL fallback for SVG/alt markup
pfefferle Mar 1, 2026
fabbfc4
Refactor templates to parts and align single-view semantics
pfefferle Mar 1, 2026
ec9110a
Semantics: add h-card classes for comment authors
pfefferle Mar 1, 2026
5806a65
Semantics: align comment author p-author schema with master
pfefferle Mar 1, 2026
e68c94e
Semantics: prevent nested comment microformats
pfefferle Mar 1, 2026
559e56e
Semantics: set explicit comment author p-name and u-url
pfefferle Mar 1, 2026
851e42c
Refine comments template spacing and semantics
pfefferle Mar 1, 2026
61fbd4b
Keep post-author semantics and remove single author bio blocks
pfefferle Mar 1, 2026
aa55ac5
Fix escaping, dead code, template markup, and code quality issues
pfefferle Mar 2, 2026
0d602c2
Add base/contrast colors for dark theme
pfefferle Mar 4, 2026
bdcf171
Refactor dark mode to use light-dark() and clean up CSS
pfefferle Mar 4, 2026
2b27473
Update typography scale and add missing font weights
pfefferle Mar 28, 2026
d780b2d
Add constrained layout to archive post-content
pfefferle Mar 28, 2026
ac0a5d3
Fix branding gap in header on small viewports
pfefferle Mar 28, 2026
d034358
Switch header search to icon-only button
pfefferle Mar 28, 2026
f37407d
Move search inside navigation and add overlay template part
pfefferle Mar 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
sass/ export-ignore
.DS_Store export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.wp-env.json export-ignore
build-scripts/ export-ignore
docker-compose.yml export-ignore
Gruntfile.js export-ignore
node_modules/ export-ignore
package.json export-ignore
phpcs.xml export-ignore
readme.md export-ignore
src/ export-ignore
webpack.config.js export-ignore
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
/vendor/
.DS_Store
_build
build/*
!build/post-format/
!build/post-format/**
composer.lock
package-lock.json
15 changes: 15 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"core": "WordPress/WordPress#master",
"phpVersion": "8.1",
"themes": [
"."
],
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": false,
"SCRIPT_DEBUG": true
},
"port": 8887,
"testsPort": 8890
}
45 changes: 0 additions & 45 deletions 404.php

This file was deleted.

26 changes: 0 additions & 26 deletions 500.php

This file was deleted.

112 changes: 112 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Overview

Autonomie is a WordPress **Full Site Editing (FSE) block theme** (v2.0.0) focused on semantic HTML — microformats, microformats2, and Schema.org microdata. It is fully IndieWeb-compatible. Recently migrated from a classic PHP theme to the FSE architecture (branch: `fse`).

Requires WordPress 6.4+, PHP 7.4+, Node.js 18.0+.

## Roadmap / Current Status

We are on the `fse` branch. The work is in two phases:

- **Phase 1 (complete):** Design foundation cleanup — removed Grunt remnants, deleted AI-generated migration docs, added missing spacing presets to `theme.json`, deduplicated colors, added missing block styles (footnotes, comments, gallery, image, separator), ported missing CSS from classic theme (tables, forms, comments, typography, dark mode fixes), replaced hardcoded pixel values with spacing preset variables.
- **Phase 2 (next):** Social-media-inspired post format templates — status posts styled like toots/tweets, image posts like Pixelfed/Instagram, link posts like bookmarks, etc. Uses `single_template_hierarchy` filter for format-specific templates.

## Commands

```bash
# Build the custom block (src/post-format → build/post-format)
npm run build

# Watch mode for development
npm run dev

# Local WordPress environment (port 8887, WP 6.7, PHP 8.1)
npm run start # Start wp-env
npm run stop # Stop wp-env

# Linting
npm run lint:php # PHP CodeSniffer (WordPress-Core ruleset)
npm run lint:md # Markdown linting
npm run format # Prettier for JSON/MD files
```

No test suite is configured yet.

## Development Workflow

1. `npm run start` boots wp-env at http://localhost:8887 (admin: admin/password)
2. `npm run dev` watches `src/post-format/` and rebuilds on change
3. Edit `theme.json` for design tokens, block styles, and layout — changes are live-reloaded
4. Edit `style.css` for styles that can't be expressed in theme.json (pseudo-elements, complex selectors, dark mode)
5. Edit `templates/` and `parts/` for block template markup
6. Test dark mode by toggling system appearance preferences
7. Validate microformats at https://indiewebify.me/

## Architecture

### FSE Block Theme Structure

- **`theme.json`** — Primary design system (version 3): colors, typography, spacing, layout (700px content / 900px wide), per-block styles. Most styling lives here, not in CSS files.
- **`templates/`** — 6 HTML block templates (index, single, page, archive, search, 404)
- **`parts/`** — 3 template parts (header, footer, post-meta)
- **`patterns/`** — 10 block patterns, one per post format (standard, aside, quote, link, image, gallery, video, audio, status, chat). Note: pattern registration is currently disabled in functions.php due to inconsistent return formats — `post-aside.php` returns differently from the rest. This needs fixing before Phase 2.
- **`style.css`** — Only styles that can't be expressed in theme.json: pseudo-elements, complex selectors, dark mode (`prefers-color-scheme: dark`), tables, forms, comments, accessibility helpers.

### Custom Block: `autonomie/post-format`

Single custom block in `src/post-format/` displaying the post format icon and archive link.

- `src/post-format/index.js` — Editor component (React/JSX)
- `src/post-format/render.php` — Server-side render
- `src/post-format/icon-paths.php` — Auto-generated by `build-scripts/extract-icons.js` (runs as prebuild/predev)
- Built via `@wordpress/scripts` (webpack) to `build/post-format/`
- `webpack.config.js` extends `@wordpress/scripts` default config with CopyWebpackPlugin for PHP files

### PHP Includes

- **`includes/semantics.php`** — Core file (~630 lines). Adds microformats2 classes and Schema.org microdata to block output via `render_block` filters for core blocks (post-template, post-title, post-content, post-date, post-author, etc.) and classic WordPress filters (body_class, post_class, etc.).
- **`includes/feed.php`** — Feed discovery links, per-format feed URLs
- **`includes/compat.php`** — Backward compatibility: comment form enhancements, "standard" post format archive support, lazy loading
- **`includes/webactions.php`** — IndieWeb webaction wrappers for comment links

### Architecture Decisions

- **Semantic markup via render_block filters** — microformats2 + Schema.org is injected by filtering rendered block output in `semantics.php`, not by modifying templates directly. This keeps templates clean and portable.
- **Dark mode via CSS variable overrides** — `@media (prefers-color-scheme: dark)` in `style.css` overrides the theme.json color CSS custom properties. This is the only reliable approach until theme.json supports color-scheme natively.
- **Self-hosted fonts** — Lato, Merriweather, and OpenWeb Icons are declared in `theme.json` fontFace entries. No external font CDNs.
- **Spacing presets for consistency** — Hardcoded pixel values in block styles have been replaced with `var(--wp--preset--spacing--XX)` references. New presets were added for 15px (slug 35), 30px (slug 55), 50px (slug 75), and 60px (slug 78) to complement existing presets.
- **CSS vs theme.json boundary** — theme.json handles colors, typography, spacing, border, and layout. CSS handles pseudo-elements (::before, ::after), complex selectors (nth-child, descendant combinators), box-shadow, width constraints, and `@media` queries.

## What's Next (Phase 2)

### Post Format Templates

The plan is to create social-media-inspired templates for each post format:

- **Status** → Toot/tweet style (avatar, short text, timestamp)
- **Image** → Pixelfed/Instagram style (image-first, minimal chrome)
- **Link** → Bookmark card (URL preview, title, description)
- **Quote** → Large typographic quote
- **Video/Audio** → Embedded player focus
- **Gallery** → Grid/masonry layout
- **Aside** → Note/microblog style
- **Chat** → Conversation thread

Implementation approach:
1. Fix pattern registration (inconsistent format in `post-aside.php` vs others)
2. Use `single_template_hierarchy` filter to load format-specific templates from `templates/single-format-{format}.html`
3. Create format-specific template parts in `parts/`

### Classic Theme Reference

The `master` branch still has the classic theme for visual reference. The old SCSS partials in `assets/sass/` (`_base.scss`, `_post.scss`, `_comment.scss`, `_table.scss`, `_form.scss`, etc.) are the source of truth for what the theme should look like.

## Coding Standards

- PHP: WordPress-Core ruleset (phpcs.xml)
- Indentation: tabs (size 4) for PHP/CSS/HTML; spaces (size 2) for JS/JSON (.editorconfig)
- LF line endings, UTF-8
153 changes: 0 additions & 153 deletions Gruntfile.js

This file was deleted.

Loading