Repository navigation
Scope AI to page sections and verticals, add wp waygate build, fix stripped backslashes (1.1.0) - #13
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes Waygate useful for building Elayne verticals and child themes (e.g. Elayne Legal).
AI page generation scoping
elayne-legal→legal) and falls back to all sections when the vertical has fewer than three.waygate_verticals,waygate_structural_categories.WP-CLI (no AI)
wp waygate build <map.json> [--dry-run] [--references]builds pages from a JSON map. Pages are matched byidorslug, and an unknown slug creates a draft. Pattern content is inlined with nestedwp:patternreferences expanded, the same way a block-editor insert stores it.wp waygate list [--vertical=] [--sections] [--format=].Fix
create_page()/create_page_from_content()passed unslashed content towp_insert_post(), which unslashes it, so backslashes in block JSON (-,\") were stripped. Now wrapped inwp_slash(), and the new CLI writes use it too.Version bumped to 1.1.0 (
waygate.php,readme.txt,CHANGELOG.md).Testing
vendor/bin/phpunit: 72 tests pass (was 47). The new backslash test fails without the fix.vendor/bin/phpcs: clean. Each commit was checked on its own./legal/subsite (Elayne Legal active):wp waygate list --sections --vertical=legalreturns 14 patterns. The header, footer and 4 page composites are excluded. Across all patterns, 134 drop to 89 sections.build --dry-runreports create/update per page. An unknown slug warns and the command exits non-zero.page-legal-aboutproduced content identical to demo pages 5 and 7. The only differences are the media-library band photo and portraits thatrebuild-demo-subsite.phpadds. Nested references were fully expanded and new pages were created as drafts. The test pages were deleted afterwards and the demo's Composer copy restored.Not covered
generate_page()) is unit-tested only. It hasn't been run against a live provider.composer.jsonpinsimagewize/waygateto<1.0.0, so the demo needs a constraint bump to use 1.1.0.