Content blocks: Shown in the page, the card only, or both (migration 071)

A card block also showed on the record's page (the pages printed the
card's paragraphs above the body), which the editor didn't say. Shown
in now offers The page, The card only, and The card and the page.
Every existing card block becomes both, so nothing on the site moves;
the pages no longer print card paragraphs, and a both block comes
with the page's blocks, in its place in the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-06 05:27:33 -05:00
parent b55b088e16
commit 8d6bb8c2b8
10 changed files with 103 additions and 32 deletions

View file

@ -165,7 +165,10 @@ const pageBody = (what) => [
["button", { text: "Get involved", href: "/feedback" }],
];
/* The card slot: paragraphs only, shown on cards and list rows. */
/* Card text: paragraphs only, shown on cards and list rows. Most
records put it in "both" (the card and the page); the series and
the past event keep it to the card, to check that it stays off
their pages. */
const cardText = (what) => [
["paragraph", { text: `Showcase ${what}: the short description that appears on its card.` }],
["paragraph", { text: "A second card paragraph, to check how two read." }],
@ -259,7 +262,7 @@ tx(db, () => {
insert("region_areas", { region_id: REGION, area_code: "PA", share: 0.5, edge: "top", note: "western half" });
insert("region_areas", { region_id: REGION, area_code: "OH", share: 1 });
links("organization", REGION, standardLinks("Showcase Region"));
blocks("organization", REGION, "card", cardText("region"));
blocks("organization", REGION, "both", cardText("region"));
blocks("organization", REGION, "body", pageBody("region"));
insert("organizations", {
@ -279,7 +282,7 @@ tx(db, () => {
insert("groups", { id: GROUP, region_id: REGION, meets: "2nd Sundays, 6:00pm", started: "Since 2021" });
["in-person", "online"].forEach((tag_id, i) => insert("organization_tags", { org_id: GROUP, tag_id, sort_order: i }));
links("organization", GROUP, standardLinks("Showcase Group"));
blocks("organization", GROUP, "card", cardText("group"));
blocks("organization", GROUP, "both", cardText("group"));
blocks("organization", GROUP, "body", pageBody("group"));
/* ── People ── */
@ -315,7 +318,7 @@ tx(db, () => {
{ kind: "website", label: "Website", url: "https://example.org/person" },
{ kind: "action", label: "Book a call", url: "https://example.org/call" },
]);
blocks("person", PERSON, "card", cardText("person"));
blocks("person", PERSON, "both", cardText("person"));
blocks("person", PERSON, "body", pageBody("person"));
MEMBERS.forEach((id, i) =>
@ -346,7 +349,7 @@ tx(db, () => {
sort_order: 99,
});
links("team", TEAM, [{ kind: "action", label: "Join the team", url: "https://example.org/join" }]);
blocks("team", TEAM, "card", cardText("team"));
blocks("team", TEAM, "both", cardText("team"));
blocks("team", TEAM, "body", pageBody("team"));
insert("affiliations", { person_id: PERSON, org_id: REGION, team_id: TEAM, title: "Showcase Team Lead", role: "lead", is_owner: 1, started_on: "2023-01-01", is_public: 1, sort_order: 0 });
@ -392,7 +395,7 @@ tx(db, () => {
{ kind: "action", platform: "discord", label: "Event Discord", url: "https://discord.com/invite/example" },
{ kind: "social", platform: "instagram", label: "@showcaseretreat", url: "https://instagram.com/showcaseretreat" },
]);
blocks("event", EVENT, "card", cardText("event"));
blocks("event", EVENT, "both", cardText("event"));
blocks("event", EVENT, "body", [...pageBody("event"), ["heading", { text: "Schedule" }], SCHEDULE]);
insert("events", {