feat: cards grid element with hidden card items child #99
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!99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/92"
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?
Adds the
cards/cardcore element pair from the issue spec, replicating the establishedimage/imgitems-collection pattern.What ships
scaffold/editor/elements/cards.yaml— grid parent (items: {element: card},colsselect 2/3/4 default 3,allowedIn: [page])scaffold/editor/elements/card.yaml— hidden child (allowedIn: [cards],summary: heading; optional image, required heading, textarea blurb, link)scaffold/themes/deckle/layouts/shortcodes/cards.html+card.html— the parent-Scratch collection pattern (deckleCardskey): children push dicts in document order, parent renders the grid; honors the reserveddisabledflag (bare bool and quoted) and has the hand-authored standalone fallback, mirroringimg.htmlscaffold/themes/deckle/layouts/partials/ce/card.html— shared per-card renderer: withlinkthe root is a single wrapping<a class="ce-card">(no nested interactive elements), honoring thelinkTargetcompanion with the byte-exacttarget="_blank" rel="noopener"pair; without link a plain<div class="ce-card">theme.css—.ce-cardsgrid reusing the.ce-imagesbreakpoints (1 col mobile, 2 at 40em, cols max at 48em) and modest.ce-cardstyling from existing tokens onlyNo Go or web changes were needed: element discovery, embedding, the collection-rows editor UI (add, drag-reorder, collapse, heading summary), and picker/tree hiding are all schema-driven.
Acceptance criteria
cardishidden: trueso it never appears in picker or tree (genericallowedElements/flattenChildrenfiltering, covered by existing web tests)summary: headingTestCardsInProductioncolsis a max, collapsing on narrow viewports like the image grid (same 40em/48em breakpoints)buildLibrarySite(TestCardsInProduction,TestProductionBuildHygiene,TestContentRoundTripall green; the zero-cards element renders nothing at all)Verification
go test ./...green with real hugo 0.164 on PATH (theme/publish integration tests ran, not skipped);gofmt/go vetcleanweb:npm run build+vitest— 792/792 pass (no web changes; confirms no regression)Closes #92
🤖 Generated with Claude Code
Landing review — verdict: PASS.
ci / build-and-testgreen (9m57s); relied on as the verification signal, not re-run. Itsgo test ./...ran with real Hugo on PATH.Closes #92present.main; purely additive (356 insertions, 0 deletions).img/imageitems-collection pattern (ScratchdeckleCards,.Inner-first,disabledhonored, standalone fallback); linked card renders a single wrapping<a class="ce-card">withlinkTarget→target="_blank" rel="noopener", unlinked renders a plain<div>.TestCardsInProductionpins the single-anchor span, exactly-2 anchors, and the zero-cards-renders-nothing contract.No blockers found. Awaiting the maintainer's free-text go-ahead to merge.