feat: cta core element — full-width tinted call-to-action strip #101
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/91"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #91
What
A new
ctacore element: a full-width tinted call-to-action strip with centered content, distinct fromhero(which remains the page lead).scaffold/editor/elements/cta.yaml— exactly as specified in the issue (rte body withallow: [bold, italic, link],allowedInline: [button],allowedIn: [page], optionalheadingtext param), plus the conventionalicon:(lucide:megaphone, verified present in the web app's lucide set).scaffold/themes/deckle/layouts/shortcodes/cta.html—<section class="ce-cta">withce/attrs; the optional heading renders as an h3 (a step below hero's h2, per the issue), guarded bywithso an empty/absent heading emits no heading tag at all.--color-accent-tint, same AA-passing pairing hero uses) via breakout margins from inside.container, centered content in a--measurecolumn. Two hardening rules the strip forced: a contained-strip fallback inside multi-column layout slots (.ce-layout__cols .ce-cta— the two-col main/sidebar cells have noelementsrestriction, and a viewport bleed there would smear across the neighboring column) andoverflow-x: cliponbody(classic scrollbars make 100vw overshoot by the bar width, which would break the theme's "no horizontal overflow" promise).--color-accent-tintnote (hero/cta background), heading-hierarchy paragraph extended for the h3.TestCtaRenderingInProductionpins the rendered contract on a real Hugo build (2 strips, exactly one heading tag, both button chips).scaffold/site/AGENTS.mdis untouched on purpose: cta introduces no new field type, body policy, or rte token, and the manual documents the schema without enumerating elements (theagentsdocdrift test passes).Acceptance criteria — verified
--color-texton--color-accent-tint≈ 13.7:1)422: element "cta" is not allowed inside "accordion")CoerceValuesdrops the empty text param on save)harnessbinary:GET /api/elementslists cta → insert at page level → save heading + body with{{< button >}}chip → canonical shortcode on disk → publish (real Hugo pre-flight build) → published HTML shows the strip with the button, and no<h3>in the headless variantTests
webvitest: 40 files / 792 tests passed.go test ./...: all packages ok (includes sidecar↔template parity, attrs, content round-trip, production hygiene/anchors, AGENTS.md drift, and the new cta rendering test), re-run uncached after the final CSS change.🤖 Generated with Claude Code
Landing review — verdict: PASS (merge conflict resolved).
ci / build-and-testgreen (run #82, 9m15s) on the PR head — predatesmainadvancing, so the resolution below was re-verified locally.Closes #91present.allow: [bold, italic, link],allowedInline: [button],allowedIn: [page], optional heading); shortcode renders a tinted<section class="ce-cta">with an optional h3 heading (empty heading emits no tag) and a button-chip rte body. Pinned byTestCtaRenderingInProduction.Merge conflict (
mainadvanced via the #99 + #100 merges):internal/theme/theme_test.go—TestCtaRenderingInProduction(this PR) andTestCardsInProduction(from #99, now on main) tangled on identical opening boilerplate. Resolved as a union: both test functions kept in full, gofmt-clean.scaffold/themes/deckle/README.md— kept this PR's new CTA-h3 heading-hierarchy sentence and used main's current icon prose (built-in stroke SVGs), dropping this PR's now-stale "neutral placeholder glyph" wording (superseded by #100).Re-verification on the resolved tree (merge commit
4186fad, pushed toafk/91):go build ./...+go vetclean; fullgo test ./internal/theme/passes, including the real-Hugo build of the merged kitchen-sink fixture rendering CTA, Cards, and icons together.No blockers. Awaiting the maintainer's free-text go-ahead to merge.