feat: v3.15.0 — page authoring + reach copy (closes #78, #79)#81
Merged
Conversation
Exports a slug contract for compose/new-page writes (Phase 2 prereq). Stricter than FileSystemRepository.validateSlug, which stays permissive for already-stored slugs at admin surfaces.
Closes #79. Separate route renders the form in page mode: required slug input, type=page hidden, banner/tags/categories/link_url hidden. Edit of an existing page surfaces the same mode (header + hidden fields) while keeping the slug immutable. CreatePost branches on TypePage — explicit slug, no date frontmatter. Handler validates the operator's slug via article.ValidateSlug plus a uniqueness check against the in-memory store. FAB stays thought-scoped.
Closes #78. Three new ABOUT_REACH_HEADING / ABOUT_EMAIL_HEADING / ABOUT_EMAIL_INTRO env vars; pattern parity with the v3.14.0 AMA copy wiring. Defaults match the current template literals byte-for-byte so /about renders identically without operator override.
End-to-end regression guard for /compose/edit/<page-slug> POST. UpdateArticle's generic-map preservation is locked by sibling tests; this asserts the handler+form plumbing carries type=page round-trip so a future refactor can't silently drop it.
Collaborator
Author
Code reviewFound 1 issue:
markgo/internal/services/article/predicate.go Lines 55 to 60 in 1d9620e Suggested fix: change markgo/internal/handlers/compose.go Lines 20 to 24 in 1d9620e |
ValidateSlug regex tightened to require alphanumeric at both ends so operator-supplied slugs match the codebase-wide validSlug gate; a page with `-foo` would otherwise be created but immediately uneditable. Page submission now rejects empty title server-side (template gains a required attribute too). Edit-form Cancel link routes through a new canonicalPath data field so type:page edits return to /p/<slug> instead of triggering the v3.13.0 301 via /writing/<slug>.
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.
Wave-4 of log.1mb.dev operator feedback closes the v3.13.0/v3.14.0 deferred threads for
type:pagefirst-class authoring (#79) and operator-voiced/aboutreach copy (#78). The four commits split as: new exportedarticle.ValidateSlugcontract for operator-supplied slugs (strict charset + length + reserved set{index,feed,rss,atom});/compose/new-pageroute renderingcompose.htmlin page mode viadata-mode(slug field required, banner/tags/categories/link_url hidden, hiddentype=page); three newABOUT_REACH_HEADING/ABOUT_EMAIL_HEADING/ABOUT_EMAIL_INTROenv vars wired through the existingabout_handlerpattern with byte-exact defaults; and a regression test locking thetype:pageedit-roundtrip contract. Plan deviated at execution: the original Phase 1 (edit-loses-type fix) was dropped afterTestUpdateArticle_PreservesAMAFieldsconfirmedUpdateArticlealready preserves unknown frontmatter via generic-map round-trip — plumbing absorbed into the page-affordance commit instead. Verified viamake lint(cache-cleaned, 0 issues),make testgreen, an 11-scenario manual smoke matrix on the dev server, and byte-exact/aboutdefault rendering against the v3.14.0 baseline. Follow-up #80 filed for the adjacentBLOG_AUTHOR_EMAILplaceholder-default surface — deferred because it's a config-default change with its own scope.Closes #78, #79.