Page features: directory and blog post tabs, image converter, version names
- Featured event badge: above the event's card from lg up, left out on phones - Version names from the tag (The Region Cards Update) in the site and admin footers - Tools -> Image converter (JPG, PNG, WebP in the browser) and Download as in Media - People directory sections take several tags, a tab each (migration 078) - Tab blocks split a blog post into tabs; contents follow the open tab (migration 079) - The side nav sun fades out as the page scrolls into the footer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a6c66d4607
commit
31afa889d6
28 changed files with 878 additions and 70 deletions
|
|
@ -1,17 +1,42 @@
|
|||
import { mediaUrl } from "../media.ts";
|
||||
import { PUBLISHED_FIELD, LISTED_FIELD, blocksChild } from "./shared.ts";
|
||||
import { PUBLISHED_FIELD, LISTED_FIELD, BLOCK_TYPES, TEXT_TYPES, blocksChild } from "./shared.ts";
|
||||
|
||||
/* ── Blog (031_blog.sql) ─────────────────────────────────────────
|
||||
Posts at /blog/:id. The Community page's blog section is edited
|
||||
with that page (sitePages.ts). */
|
||||
|
||||
/* A post's body is the content blocks without the card/body choice:
|
||||
a post only has a body. */
|
||||
a post only has a body. Posts also take Tab blocks (079), which
|
||||
split the post into tabs (BlogPost.tsx, splitTabs). */
|
||||
const TAB_TYPE = [
|
||||
"tab",
|
||||
"Tab",
|
||||
"Starts a tab, titled by its text, holding the blocks after it up to the next Tab. Blocks before the first Tab are the intro above the tabs. The contents list follows the open tab.",
|
||||
];
|
||||
const POST_BLOCK_TYPES = [...BLOCK_TYPES, TAB_TYPE];
|
||||
|
||||
const blogBlocksChild = {
|
||||
...blocksChild,
|
||||
label: "Post body",
|
||||
note: "The post, top to bottom. The first paragraph doubles as the excerpt when that's left blank.",
|
||||
fields: blocksChild.fields.filter((field) => field.path !== "slot"),
|
||||
note: "The post, top to bottom. The first paragraph doubles as the excerpt when that's left blank. Add Tab blocks to split it into tabs.",
|
||||
fields: blocksChild.fields
|
||||
.filter((field) => field.path !== "slot")
|
||||
.map((field) =>
|
||||
field.path === "type"
|
||||
? {
|
||||
...field,
|
||||
options: POST_BLOCK_TYPES.map(([value, label]) => [value, label]),
|
||||
help: (row) => POST_BLOCK_TYPES.find(([value]) => value === row?.type)?.[2],
|
||||
}
|
||||
: field.path === "text"
|
||||
? {
|
||||
...field,
|
||||
label: (row) => (row?.type === "tab" ? "Tab title" : (field.label as any)(row)),
|
||||
when: { path: "type", value: [...TEXT_TYPES, "tab"] },
|
||||
help: (row) => (row?.type === "tab" ? "eg. Overview" : (field.help as any)(row)),
|
||||
}
|
||||
: field,
|
||||
),
|
||||
};
|
||||
|
||||
export const blogPosts = {
|
||||
|
|
|
|||
|
|
@ -102,19 +102,6 @@ const sectionsChild = (presets: string[]) => ({
|
|||
},
|
||||
]
|
||||
: []),
|
||||
...(presets.includes("people_directory")
|
||||
? [
|
||||
{
|
||||
path: "tag_id",
|
||||
label: "Directory: tag",
|
||||
widget: "select",
|
||||
optionsFrom: "person_tag_types",
|
||||
blankLabel: "Default: none (shows nothing)",
|
||||
help: "Shows the first of its people and links to the full directory",
|
||||
when: { path: "preset", value: "people_directory" },
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(presets.includes("partner_list")
|
||||
? [
|
||||
{
|
||||
|
|
@ -146,6 +133,16 @@ const sectionsChild = (presets: string[]) => ({
|
|||
: []),
|
||||
],
|
||||
children: [
|
||||
{
|
||||
key: "tags",
|
||||
label: "Directory: tags",
|
||||
note: "Each People tag is a tab, in this order, eg. Musicians, Authors, Creators: the first of its people, and a link to its full directory. One tag shows without tabs. Tags are made under Data → People tags.",
|
||||
addLabel: "Add tag",
|
||||
when: { path: "preset", value: "people_directory" },
|
||||
title: (row, options) => options?.person_tag_types?.find((t) => t.id === row.tag_id)?.label ?? "New tag",
|
||||
blank: { tag_id: "" },
|
||||
fields: [{ path: "tag_id", label: "Tag", widget: "select", optionsFrom: "person_tag_types", required: true }],
|
||||
},
|
||||
{
|
||||
key: "orgs",
|
||||
label: "Cards: organizations",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue