diff --git a/TODO.md b/TODO.md
index 0381195..61b0a9e 100644
--- a/TODO.md
+++ b/TODO.md
@@ -60,13 +60,16 @@
- [ ] Which page showed the wrong picture, and where (Discord, iMessage, Facebook)? Answer:
- [ ] Is it production (not deployed yet?) or the SVG skip? Should an SVG logo get a PNG copy made at upload for previews? Answer:
- [ ] Should event pages prefer the card background ("banner") over the event photo? Answer:
-
+- [ ] **Blog page tabs**: tabs within a blog post, at the top.
+ - [ ] each tab would switch the active display of content and table of contents, there could be some title/intro content above the tabs.
- [ ] **Gamification synced to Discord**: points, badges or levels on the site, synced to Discord. Linking a profile to Discord is done (Part 2, Accounts); the bot, points and badges are next.
- [ ] What earns points: going to events, writing for the blog, volunteering, Discord activity? Answer: all of the above, we could create badges on profiles.
- [ ] Where are they shown: on full profiles, a leaderboard, only in Discord? Answer: shown on profiles when logged in, no leaderboard for now, and when using a command in discord. this content would not show on the public bio section of a user when viewing from a people tile.
- [ ] Which way does it sync: site → Discord roles, Discord → site, or both? Is there a Discord bot already (or only the reports webhook)? Answer: would like a bot built, for if things in discord update or affect gamification shown on the website. most things will be assigned to users by moderators.
- [ ] How do we match a person to their Discord account (they link it themselves)? Answer: they can link it, admins can overwrite and update/set
-- [ ] **Site version names**: in the footers now (Part 2, Page features); still to show them in the changelog once it's built (Pages: Website changelog).
+- [ ] **Site version names**: each update gets a name, "The ___ Update", Minecraft style.
+ - [ ] Shown where: the footer next to the version, the changelog, both? Answer: both
+ - [ ] Does the tag suffix become the name (v1.13.2-region-cards → "The Region Cards Update"), or a name of its own? Answer: yeah the tag.
## Accessibility Features
- [ ] Check the mobile fixes on a real phone (or the browser's phone view at 320, 375 and 430px), light and dark: every page, the menu, the hero, the retreat carousel, people tiles and their details, the community map, schedule blocks, the banner.
@@ -76,6 +79,9 @@
- [ ] A Listen button in the Accessibility panel, or on each page by its title? Answer:
## Mobile
+- [ ] **Featured event label on the front page**: where it sits doesn't make sense, at least on mobile.
+ - [ ] Where should it go: above the card, on the card's photo, or dropped on mobile? Answer: droppd on mobile
+ - [ ] Same change on desktop? move above the section on the right displaying the featured event.
## Page Editing
@@ -88,12 +94,17 @@
- [ ] Which fields: name, photo, email, phone, birthday? Which win when both sides differ? Answer:
- [ ] How often: a button in Data, hourly, nightly? Answer: manually only
- [ ] Is there a Planning Center API app (personal access token) we can use, and which account owns it? Answer: use the API
- - Skipped on 2026-10-16 until the fields (and which side wins) are decided.
-- [ ] **New Thought young adult directory**: the tabs are built (Part 2, Page features). Content: make the People tags (eg. Authors, Creators), tag people, and set Community's Directories section to them.
+- [ ] **New Thought young adult directory**: things like authors and TikTok and Instagram creators.
+ - [ ] section in the community page, Directories. tabs with different people lists, we have musicians already.
+ - [ ] Do they agree to be listed, or is it a public list of public accounts? Answer: we add them to the list as admins
## Navigation
## Tools
+- [ ] **File conversion**: a simple tool, eg. WebP to JPG.
+ - [ ] Which conversions: images only (WebP, JPG, PNG, HEIC?), or also documents (Word to PDF) and video? Answer: image converson
+ - [ ] In the browser (nothing uploaded, images only), or on the server (more formats)? Answer: images only.
+ - [ ] Also a "Download as JPG" on files in the Media library? [ ] yes
## Content
- [ ] **Newsletter: featured partners and new partnerships**, maybe as a blog post.
@@ -122,15 +133,6 @@
# Part 2: Done
-## v1.14.0-profiles: page features (branch `page-features`, with `nav-access` under it, no PR yet; migrations 078 and 079, back up the database before deploying)
-- [x] **Featured event label** (Mobile): the "Featured event" badge left the headline; from lg up it sits above the event's card it names, and on a phone (the card under the words) it's left out.
-- [x] **Site version names**: the tag's words after the number are the version's name, `v1.13.2-region-cards` → "The Region Cards Update" (`src/lib/version.ts`), shown with the number in the site's footer and beside the version in the admin's footer and home.
-- [x] **Image converter** (Tools → Image converter): pictures to JPG, PNG or WebP in the browser (nothing uploaded): pick or drop several, a quality slider for JPG and WebP, download each or all. JPG fills transparency white. Media's images each have a Download as… (JPG, PNG, WebP) doing the same (`src/lib/convertImage.ts`).
-- [x] **Directory tabs** (migration 078): the People directory preset takes several People tags, a tab each in the order picked (Directory: tags under the section); one tag shows without tabs, reading mode lists every tag. Each section's old single tag became its first.
-- [x] **Blog post tabs** (migration 079): a Tab block in a post (its text the tab's title) starts a tab holding the blocks after it; blocks before the first Tab are the intro above the tabs. The contents list follows the open tab, a link to a heading in another tab opens it, and Download PDF and reading mode show every tab under its title. Outside a post a Tab block reads as a heading.
-- [x] **Side nav sun into the footer** (Navigation): the sun is far bigger than the sticky layer that carries it, so once the last section went up past the list it hung over the footer. It now fades out as the list leaves with the last section, and back in on the way up.
- - [ ] Check in a browser: the side nav sun fading at the end of a long page (2xl screen) and with a tall footer; the featured event hero at phone and desktop width, the footers' version line, converting a PNG with transparency to JPG and a JPG to WebP (and Download as in Media), a Directories section with two tags and with one, a post with an intro and three tabs (contents, keyboard arrows, PDF, reading mode).
-
## Page Editing (branch `nav-access`, no PR yet; migration 077)
- [x] **Drafts of every record** (migration 077, `docs/drafts.md`): an existing record of any kind (events, people, organizations, blog posts, the front page, the site pages, Navigation, Site settings...) can be saved as a draft instead of going live. One draft per record; anyone who can edit it can save, preview, publish or discard it. Opening a record with a draft opens the draft, saying who saved it and when, and warning when the live record was saved since. Lists mark records with a draft.
- [x] **Preview on the real page**: Preview saves the draft and opens the record's page in a new tab with it applied, under an amber "Previewing a draft" bar, for signed-in admin accounts only; anyone else sees the live page. The server answers that tab's reads from a second connection holding the draft in a transaction it rolls back, so no page needed code of its own.
diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js
index d524795..da5ec75 100644
--- a/server/src/admin-schema/columns.js
+++ b/server/src/admin-schema/columns.js
@@ -152,8 +152,6 @@ export const blocksChild = (ownerKind) => ({
"table",
"cards",
"people",
- // A blog post's tab (079): its text is the tab's title.
- "tab",
],
{ required: true },
),
diff --git a/server/src/admin-schema/sitePages.js b/server/src/admin-schema/sitePages.js
index 5a28fc1..ddc1836 100644
--- a/server/src/admin-schema/sitePages.js
+++ b/server/src/admin-schema/sitePages.js
@@ -36,19 +36,12 @@ const sectionsChild = {
text("scope_id"),
enumeration("event_type", ["retreat", "class", "workshop", "meeting", "other"]),
enumeration("view", ["carousel", "grid", "map"]),
+ text("tag_id"),
// Organization cards (067): the kinds listed by themselves.
enumeration("org_kinds", ["partner", "ministry", "partner,ministry"]),
],
children: [
blocksChild("page_section"),
- {
- // A People directory's tags (078), a tab each, in order.
- key: "tags",
- table: "page_section_tags",
- owner: { column: "section_id" },
- order: "sort_order",
- columns: [text("tag_id", { required: true })],
- },
{
// Organization cards (067): a hand-picked list, shown instead.
key: "orgs",
diff --git a/server/src/migrations/078_directory_tabs.sql b/server/src/migrations/078_directory_tabs.sql
deleted file mode 100644
index 500ad31..0000000
--- a/server/src/migrations/078_directory_tabs.sql
+++ /dev/null
@@ -1,66 +0,0 @@
--- ═══════════════════════════════════════════════════════════════
--- 078 DIRECTORY TABS
---
--- A People directory section (page_sections.preset
--- 'people_directory') shows several People tags, a tab each, in
--- the order picked: Community's Directories, eg. Musicians, Authors,
--- Creators. page_section_tags holds them; each section's one tag_id
--- becomes its first, and the column goes (page_sections is rebuilt,
--- since a column with a REFERENCES can't be dropped in place).
--- ═══════════════════════════════════════════════════════════════
-
-CREATE TABLE page_section_tags (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- section_id INTEGER NOT NULL REFERENCES page_sections (id) ON DELETE CASCADE,
- sort_order INTEGER NOT NULL DEFAULT 0,
- tag_id TEXT NOT NULL REFERENCES person_tag_types (id) ON DELETE CASCADE
-) STRICT;
-
-CREATE INDEX page_section_tags_section_idx ON page_section_tags (section_id, sort_order);
-
-INSERT INTO page_section_tags (section_id, sort_order, tag_id)
-SELECT id, 0, tag_id FROM page_sections WHERE tag_id IS NOT NULL;
-
-CREATE TABLE page_sections_new (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- page_id TEXT NOT NULL REFERENCES site_pages (id) ON DELETE CASCADE,
- sort_order INTEGER NOT NULL DEFAULT 0,
- anchor TEXT NOT NULL
- CONSTRAINT "A section's URL ID can use only lowercase letters, numbers and hyphens, eg. leadership."
- CHECK (anchor <> '' AND anchor NOT GLOB '*[^a-z0-9-]*'),
- title TEXT NOT NULL
- CONSTRAINT "A section title can be 30 characters at most (it's listed in the page's side nav)."
- CHECK (length(title) <= 30),
- blurb TEXT,
- accent TEXT CHECK (accent IN ('teal', 'deep', 'green', 'amber')),
- preset TEXT CHECK (preset IN ('community_blog', 'group_map', 'region_list', 'partner_list',
- 'events', 'timeline', 'people_directory')),
- -- An events preset's filter and first view.
- scope_id TEXT REFERENCES event_scopes (id) ON DELETE SET NULL,
- event_type TEXT CHECK (event_type IN ('retreat', 'class', 'workshop', 'meeting', 'other')),
- view TEXT CHECK (view IN ('carousel', 'grid', 'map')),
- -- Organization cards (067): the kinds listed by themselves.
- org_kinds TEXT CHECK (org_kinds IN ('partner', 'ministry', 'partner,ministry')),
- UNIQUE (page_id, anchor)
-) STRICT;
-
-INSERT INTO page_sections_new
- (id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view, org_kinds)
-SELECT id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view, org_kinds
- FROM page_sections;
-
--- page_section_orgs, page_section_tags and content_blocks' owner
--- trigger name page_sections; legacy mode leaves them alone through
--- the rename.
-PRAGMA legacy_alter_table = ON;
-DROP TABLE page_sections;
-ALTER TABLE page_sections_new RENAME TO page_sections;
-PRAGMA legacy_alter_table = OFF;
-
-CREATE INDEX page_sections_page_idx ON page_sections (page_id, sort_order);
-
-CREATE TRIGGER page_sections_cleanup
-AFTER DELETE ON page_sections
-BEGIN
- DELETE FROM content_blocks WHERE owner_kind = 'page_section' AND owner_id = CAST(old.id AS TEXT);
-END;
diff --git a/server/src/migrations/079_tab_blocks.sql b/server/src/migrations/079_tab_blocks.sql
deleted file mode 100644
index af58bf7..0000000
--- a/server/src/migrations/079_tab_blocks.sql
+++ /dev/null
@@ -1,76 +0,0 @@
--- ═══════════════════════════════════════════════════════════════
--- 079 TAB BLOCKS
---
--- A blog post can be split into tabs: a 'tab' block (its text the
--- tab's title) starts a tab holding the blocks after it, up to the
--- next one; the blocks before the first are the intro above the
--- tabs. The post's contents follow the open tab (BlogPost.tsx).
--- content_blocks.type's CHECK can't change in place, so the table is
--- rebuilt, then its index and owner trigger are made again.
--- ═══════════════════════════════════════════════════════════════
-
-CREATE TABLE content_blocks_new (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- owner_kind TEXT NOT NULL
- CHECK (owner_kind IN ('organization', 'event', 'person', 'team', 'blog_post', 'page_section',
- 'newsletter')),
- owner_id TEXT NOT NULL,
- slot TEXT NOT NULL DEFAULT 'body' CHECK (slot IN ('card', 'body', 'both')),
- sort_order INTEGER NOT NULL DEFAULT 0,
-
- type TEXT NOT NULL
- CHECK (type IN ('heading', 'subheading', 'paragraph',
- 'list', 'links', 'quote', 'image', 'divider',
- 'video', 'button', 'callout', 'schedule', 'table', 'cards',
- 'people', 'tab')),
- text TEXT,
- media TEXT,
- href TEXT,
- alt TEXT,
- cite TEXT,
- team_id TEXT REFERENCES teams (id) ON DELETE SET NULL,
- captions TEXT
-) STRICT;
-
-INSERT INTO content_blocks_new
- (id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions)
-SELECT id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite, team_id, captions
- FROM content_blocks;
-
--- The block items and the owners' cleanup triggers name
--- content_blocks; legacy mode leaves them alone through the rename.
-PRAGMA legacy_alter_table = ON;
-DROP TABLE content_blocks;
-ALTER TABLE content_blocks_new RENAME TO content_blocks;
-PRAGMA legacy_alter_table = OFF;
-
-CREATE INDEX content_blocks_owner_idx
- ON content_blocks (owner_kind, owner_id, slot, sort_order);
-
-CREATE TRIGGER content_blocks_owner_exists
-BEFORE INSERT ON content_blocks
-BEGIN
- SELECT CASE
- WHEN new.owner_kind = 'event'
- AND NOT EXISTS (SELECT 1 FROM events WHERE id = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such event')
- WHEN new.owner_kind = 'organization'
- AND NOT EXISTS (SELECT 1 FROM organizations WHERE id = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such organization')
- WHEN new.owner_kind = 'person'
- AND NOT EXISTS (SELECT 1 FROM people WHERE id = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such person')
- WHEN new.owner_kind = 'team'
- AND NOT EXISTS (SELECT 1 FROM teams WHERE id = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such team')
- WHEN new.owner_kind = 'blog_post'
- AND NOT EXISTS (SELECT 1 FROM blog_posts WHERE id = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such blog post')
- WHEN new.owner_kind = 'page_section'
- AND NOT EXISTS (SELECT 1 FROM page_sections WHERE CAST(id AS TEXT) = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such page section')
- WHEN new.owner_kind = 'newsletter'
- AND NOT EXISTS (SELECT 1 FROM newsletters WHERE CAST(id AS TEXT) = new.owner_id)
- THEN RAISE(ABORT, 'content_blocks: no such newsletter')
- END;
-END;
diff --git a/server/src/routes/sitePages.js b/server/src/routes/sitePages.js
index bb22705..6101056 100644
--- a/server/src/routes/sitePages.js
+++ b/server/src/routes/sitePages.js
@@ -49,7 +49,7 @@ sitePages.get("/site-pages/:id", (c) => {
const rows = db
.prepare(
- `SELECT id, anchor, title, blurb, accent, preset, scope_id, event_type, view, org_kinds
+ `SELECT id, anchor, title, blurb, accent, preset, scope_id, event_type, view, tag_id, org_kinds
FROM page_sections WHERE page_id = ? ORDER BY sort_order, id`,
)
.all(id);
@@ -64,17 +64,6 @@ sitePages.get("/site-pages/:id", (c) => {
.all(id)) {
picked.set(section_id, [...(picked.get(section_id) ?? []), org_id]);
}
- // A People directory's tags (078), in order.
- const tags = new Map();
- for (const { section_id, tag_id } of db
- .prepare(
- `SELECT t.section_id, t.tag_id FROM page_section_tags t
- JOIN page_sections s ON s.id = t.section_id
- WHERE s.page_id = ? ORDER BY t.section_id, t.sort_order, t.id`,
- )
- .all(id)) {
- tags.set(section_id, [...(tags.get(section_id) ?? []), tag_id]);
- }
// A hidden page is only for those signed in: never kept.
const send = hidden ? (body) => c.json(body, 200, NO_STORE) : (body) => json(c, body);
@@ -85,7 +74,6 @@ sitePages.get("/site-pages/:id", (c) => {
...section,
blocks: blocks.get(String(sectionId)) ?? [],
org_ids: picked.get(sectionId) ?? [],
- tag_ids: tags.get(sectionId) ?? [],
})),
},
});
diff --git a/src/App.tsx b/src/App.tsx
index 83bb43b..1744096 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -87,7 +87,6 @@ const AdminClips = lazyPage(() => import("./pages/admin/AdminClips.tsx"))
const AdminVideoFrames = lazyPage(() => import("./pages/admin/AdminVideoFrames.tsx"))
const AdminNewsletter = lazyPage(() => import("./pages/admin/AdminNewsletter.tsx"))
const AdminProfiles = lazyPage(() => import("./pages/admin/AdminProfiles.tsx"))
-const AdminConvert = lazyPage(() => import("./pages/admin/AdminConvert.tsx"))
const EntityList = lazyPage(() => import("./pages/admin/EntityList.tsx"))
const EntityEdit = lazyPage(() => import("./pages/admin/EntityEdit.tsx"))
@@ -156,7 +155,6 @@ export default function App() {
} />
} />
} />
- } />
}>
} />
diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx
index 0b035c5..e432181 100644
--- a/src/components/ContentBlocks.tsx
+++ b/src/components/ContentBlocks.tsx
@@ -63,13 +63,10 @@ export default function ContentBlocks({
accent = BRAND,
className = '',
presentAt,
- anchorPrefix = '',
}: {
blocks?: ContentBlock[] | null
accent?: string
className?: string
- /** Put before each heading's id: a blog post's tab (contents.ts, splitTabs). */
- anchorPrefix?: string
/** An event page's presentation route: each schedule gets a Present
* button to it, `?block=` naming which schedule (from 0). */
presentAt?: string
@@ -77,7 +74,7 @@ export default function ContentBlocks({
if (!blocks?.length) return null
// Headings get ids so a post's contents (PostContents) and a shared
// link (#getting-there) can point at them.
- const { idAt } = headingAnchors(blocks, anchorPrefix)
+ const { idAt } = headingAnchors(blocks)
// The heading level a block's own headings take: under the last
// heading (h3) or subheading (h4) before it, else the section's h2.
let under = 2
@@ -185,9 +182,6 @@ function Block({
const reading = useReadingMode()
switch (block.type) {
- // A blog post's tab marker (BlogPost.tsx splits the post at
- // them); anywhere else, it reads as a heading.
- case 'tab':
case 'heading':
return (
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx
index f3dda88..529ca7c 100644
--- a/src/components/Footer.tsx
+++ b/src/components/Footer.tsx
@@ -2,7 +2,6 @@ import { Link } from "react-router-dom";
import { useNavSections } from "../lib/navSections.ts";
import { useSiteNav } from "../lib/useSiteNav.ts";
import { useAuth } from "../lib/auth.tsx";
-import { VERSION_NAME, VERSION_NUMBER } from "../lib/version.ts";
import SiteLink from "./SiteLink.tsx";
import siteLogo from "../assets/logos/NGU_Logo.svg";
import PlatformIcon from "./PlatformIcon.tsx";
@@ -147,13 +146,7 @@ export default function Footer() {
{nav.legal.map((link) => (
diff --git a/src/components/PageShell.css b/src/components/PageShell.css
index 7900a5c..744d6b0 100644
--- a/src/components/PageShell.css
+++ b/src/components/PageShell.css
@@ -15,12 +15,7 @@
width 0.6s ease-in-out,
height 0.6s ease-in-out,
left 0.6s ease-in-out,
- top 0.6s ease-in-out,
- opacity 0.4s ease-in-out;
-}
-/* The page has scrolled into the footer (PageShell.tsx, leaving). */
-.side-nav-circle[data-leaving] {
- opacity: 0;
+ top 0.6s ease-in-out;
}
.side-nav-circle[data-family="green"] {
background: var(--pal-green-3);
diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx
index 2a73468..65f4676 100644
--- a/src/components/PageShell.tsx
+++ b/src/components/PageShell.tsx
@@ -215,12 +215,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
// Stuck: the page has scrolled the list up to its place under the
// header. The circle then becomes the corner sun (below).
- // Leaving: the last section is going up past the list, so the list
- // goes with it into the footer; the sun, far bigger than its sticky
- // layer, would hang over the footer, so it fades out.
const [stuck, setStuck] = useState(false);
- const [leaving, setLeaving] = useState(false);
- const listHeight = listBox?.height ?? 0;
useEffect(() => {
const column = columnRef.current;
if (!sideNav || !column) return;
@@ -228,9 +223,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
const measure = () => {
frame = 0;
const header = parseFloat(getComputedStyle(column).getPropertyValue("--header-h")) || 80;
- const box = column.getBoundingClientRect();
- setStuck(box.top + listTop <= header + STUCK_TOP + 1);
- setLeaving(box.bottom <= header + STUCK_TOP + listHeight + CIRCLE_MARGIN);
+ setStuck(column.getBoundingClientRect().top + listTop <= header + STUCK_TOP + 1);
};
const onScroll = () => {
if (!frame) frame = requestAnimationFrame(measure);
@@ -243,7 +236,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
window.removeEventListener("resize", onScroll);
if (frame) cancelAnimationFrame(frame);
};
- }, [sideNav, listTop, listHeight]);
+ }, [sideNav, listTop]);
// The circle's box, from its layer's top left (which sticks with
// the list). At rest: `rest` above. Stuck: a sun in the corner,
@@ -321,7 +314,6 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
('idle')
-
- async function download(type: OutputType) {
- setState('busy')
- try {
- const response = await fetch(url)
- if (!response.ok) throw new Error(`Couldn't fetch the picture (HTTP ${response.status}).`)
- saveBlob(await convertImage(await response.blob(), type), renamed(name, type))
- setState('idle')
- } catch (err) {
- setState(err instanceof Error ? err.message : "Couldn't convert it.")
- }
- }
-
- return (
-
-
-
- {state !== 'idle' && state !== 'busy' && {state}}
-
- )
-}
diff --git a/src/lib/adminSchema/blog.ts b/src/lib/adminSchema/blog.ts
index 7a6033d..1ea61b0 100644
--- a/src/lib/adminSchema/blog.ts
+++ b/src/lib/adminSchema/blog.ts
@@ -1,42 +1,17 @@
import { mediaUrl } from "../media.ts";
-import { PUBLISHED_FIELD, LISTED_FIELD, BLOCK_TYPES, TEXT_TYPES, blocksChild } from "./shared.ts";
+import { PUBLISHED_FIELD, LISTED_FIELD, 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. 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];
-
+ a post only has a body. */
const blogBlocksChild = {
...blocksChild,
label: "Post body",
- 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,
- ),
+ 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"),
};
export const blogPosts = {
diff --git a/src/lib/adminSchema/sitePages.ts b/src/lib/adminSchema/sitePages.ts
index 5d559a5..9e5f3f9 100644
--- a/src/lib/adminSchema/sitePages.ts
+++ b/src/lib/adminSchema/sitePages.ts
@@ -102,6 +102,19 @@ 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")
? [
{
@@ -133,16 +146,6 @@ 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",
diff --git a/src/lib/contents.ts b/src/lib/contents.ts
index 5f08590..93cd6c3 100644
--- a/src/lib/contents.ts
+++ b/src/lib/contents.ts
@@ -25,9 +25,8 @@ const slug = (text: string) =>
.slice(0, 60) || 'section'
/* One entry per heading or subheading block, in order, and the id
- for each block index that is one. prefix keeps a blog post's tabs
- apart (splitTabs): "Overview" in two tabs is two ids. */
-export function headingAnchors(blocks?: ContentBlock[] | null, prefix = ''): {
+ for each block index that is one. */
+export function headingAnchors(blocks?: ContentBlock[] | null): {
entries: ContentsEntry[]
idAt: Map
} {
@@ -41,39 +40,9 @@ export function headingAnchors(blocks?: ContentBlock[] | null, prefix = ''): {
const base = slug(text)
const n = (seen.get(base) ?? 0) + 1
seen.set(base, n)
- const id = `${prefix}${n === 1 ? base : `${base}-${n}`}`
+ const id = n === 1 ? base : `${base}-${n}`
idAt.set(index, id)
entries.push({ id, text, level: block.type === 'heading' ? 1 : 2 })
})
return { entries, idAt }
}
-
-/* ── A blog post's tabs (079) ──────────────────────────────────
- A 'tab' block starts a tab, titled by its text, holding the
- blocks after it up to the next; the blocks before the first are
- the intro above the tabs. Each tab's heading ids start with its
- own, so the same heading in two tabs is two ids; the intro's
- keep their plain ids. */
-
-export type PostTab = { id: string; title: string; prefix: string; blocks: ContentBlock[] }
-
-export function splitTabs(blocks?: ContentBlock[] | null): { intro: ContentBlock[]; tabs: PostTab[] } {
- const intro: ContentBlock[] = []
- const tabs: PostTab[] = []
- const seen = new Map()
- for (const block of blocks ?? []) {
- if (block.type === 'tab') {
- const title = (block.text ?? '').trim() || `Part ${tabs.length + 1}`
- const base = `tab-${slug(title)}`
- const n = (seen.get(base) ?? 0) + 1
- seen.set(base, n)
- const id = n === 1 ? base : `${base}-${n}`
- tabs.push({ id, title, prefix: `${id}-`, blocks: [] })
- } else if (tabs.length) {
- tabs[tabs.length - 1].blocks.push(block)
- } else {
- intro.push(block)
- }
- }
- return { intro, tabs }
-}
diff --git a/src/lib/convertImage.ts b/src/lib/convertImage.ts
deleted file mode 100644
index 3d2580f..0000000
--- a/src/lib/convertImage.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ═══════════════════════════════════════════════════════════════
- IMAGE CONVERSION, in the browser
-
- Tools → Image converter and the Media library's Download as: a
- picture redrawn on a canvas and saved as another format. Nothing
- is uploaded. Reads whatever this browser can show (JPEG, PNG,
- WebP, GIF's first frame, AVIF, BMP, SVG; HEIC in Safari only).
- JPEG has no transparency, so a JPEG's see-through parts are
- filled white.
- ═══════════════════════════════════════════════════════════════ */
-
-export const OUTPUT_FORMATS = [
- { type: 'image/jpeg', label: 'JPG', ext: 'jpg', lossy: true },
- { type: 'image/png', label: 'PNG', ext: 'png', lossy: false },
- { type: 'image/webp', label: 'WebP', ext: 'webp', lossy: true },
-] as const
-
-export type OutputType = (typeof OUTPUT_FORMATS)[number]['type']
-
-/* An SVG with no size of its own is drawn this wide. */
-const SVG_EDGE = 2048
-
-function loadImage(blob: Blob): Promise {
- const url = URL.createObjectURL(blob)
- return new Promise((resolve, reject) => {
- const img = new Image()
- img.onload = () => resolve(img)
- img.onerror = () => reject(new Error("This browser can't read that picture."))
- img.src = url
- }).finally(() => URL.revokeObjectURL(url)) as Promise
-}
-
-/** The picture as `type`; quality 0 to 1 for JPG and WebP. */
-export async function convertImage(blob: Blob, type: OutputType, quality = 0.9): Promise {
- const img = await loadImage(blob)
- const width = img.naturalWidth || SVG_EDGE
- const height = img.naturalHeight || SVG_EDGE
- const canvas = document.createElement('canvas')
- canvas.width = width
- canvas.height = height
- const context = canvas.getContext('2d')
- if (!context) throw new Error("This browser can't draw the picture.")
- if (type === 'image/jpeg') {
- context.fillStyle = '#ffffff'
- context.fillRect(0, 0, width, height)
- }
- context.drawImage(img, 0, 0, width, height)
- const out = await new Promise((resolve) => canvas.toBlob(resolve, type, quality))
- // A browser that can't write the format (old Safari and WebP)
- // hands back a PNG, or nothing.
- if (!out || out.type !== type) throw new Error(`This browser can't save ${type.split('/')[1].toUpperCase()}.`)
- return out
-}
-
-/** A file name with the new format's extension. */
-export function renamed(name: string, type: OutputType): string {
- const ext = OUTPUT_FORMATS.find((f) => f.type === type)?.ext ?? 'img'
- const stem = name.replace(/\.[^./]+$/, '') || 'image'
- return `${stem}.${ext}`
-}
-
-/** Hands the browser a file to save. */
-export function saveBlob(blob: Blob, filename: string) {
- const url = URL.createObjectURL(blob)
- const a = document.createElement('a')
- a.href = url
- a.download = filename
- document.body.appendChild(a)
- a.click()
- a.remove()
- setTimeout(() => URL.revokeObjectURL(url), 1000)
-}
diff --git a/src/lib/useContent.ts b/src/lib/useContent.ts
index 8b27a55..63abdda 100644
--- a/src/lib/useContent.ts
+++ b/src/lib/useContent.ts
@@ -38,7 +38,6 @@ export type ContentBlock = {
| 'callout'
| 'schedule'
| 'table'
- | 'tab'
| 'cards'
| 'people'
text?: string | null
diff --git a/src/lib/useSitePages.ts b/src/lib/useSitePages.ts
index 2b654ce..27eeae5 100644
--- a/src/lib/useSitePages.ts
+++ b/src/lib/useSitePages.ts
@@ -15,8 +15,8 @@ export type SitePageSection = {
scope_id?: string | null
event_type?: string | null
view?: string | null
- /** A people_directory preset's tags (Data → People tags), a tab each, in order. */
- tag_ids: string[]
+ /** A people_directory preset's tag (Data → People tags). */
+ tag_id?: string | null
/** Organization cards: the kinds listed ('partner', 'ministry' or both, comma separated). */
org_kinds?: string | null
/** Organization cards: a hand-picked list, in order, shown instead. */
diff --git a/src/lib/version.ts b/src/lib/version.ts
index 1bad3de..d5ef2c4 100644
--- a/src/lib/version.ts
+++ b/src/lib/version.ts
@@ -2,27 +2,9 @@
SITE VERSION: src/lib/version.ts
One string, bumped by hand when the working directory name
- changes. Read by the admin's footer and home, and the site's
- footer.
-
- Each version has a name, Minecraft style: the tag's words after
- the number, "v1.13.2-region-cards" → "The Region Cards Update".
- A version with no words after its number has no name.
+ changes. The admin footer is the only thing reading it today;
+ keep it here rather than in a component so the panel, an about
+ box or a build banner can read the same value later.
═══════════════════════════════════════════════════════════════ */
-export const SITE_VERSION = "NGU-Web.v1.14.0-profiles";
-
-/** The number, eg. v1.13.2. */
-export const VERSION_NUMBER: string = SITE_VERSION.match(/v\d+(?:\.\d+)*/)?.[0] ?? SITE_VERSION
-
-/** The version's name from its tag, eg. The Region Cards Update, or null. */
-export const VERSION_NAME: string | null = (() => {
- const words = SITE_VERSION.match(/v\d+(?:\.\d+)*-(.+)$/)?.[1]
- if (!words) return null
- const title = words
- .split('-')
- .filter(Boolean)
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
- .join(' ')
- return `The ${title} Update`
-})()
+export const SITE_VERSION = "NGU-Web.v1.13.2-region-cards";
diff --git a/src/pages/BlogPost.tsx b/src/pages/BlogPost.tsx
index eda2c20..cb2ade4 100644
--- a/src/pages/BlogPost.tsx
+++ b/src/pages/BlogPost.tsx
@@ -8,16 +8,9 @@
There's no /blog index on purpose: the Community page's blog
section is where posts are listed, so "back" goes there.
-
- Tab blocks (079) split the body into tabs (contents.ts,
- splitTabs): the blocks before the first are an intro above them,
- and the contents list follows the open tab. A link to a heading
- in another tab (#tab-…) opens that tab. Printed (Download PDF) or
- in reading mode, every tab shows, each under its title.
═══════════════════════════════════════════════════════════════ */
-import { useEffect, useId, useState, type KeyboardEvent } from "react"
-import { Link, useLocation, useParams } from "react-router-dom"
+import { Link, useParams } from "react-router-dom"
import PageShell, { type ShellSection } from "../components/PageShell.tsx"
import PageState from "../components/PageState.tsx"
@@ -25,11 +18,9 @@ import ContentBlocks from "../components/ContentBlocks.tsx"
import PeopleTiles from "../components/PeopleTiles.tsx"
import { mediaUrl } from "../lib/media.ts"
import { postDate, useBlogPost } from "../lib/useBlog.ts"
-import { accentText, BRAND, readableOn, withAlpha } from "../lib/color.ts"
-import { useReadingMode } from "../lib/readingMode.ts"
-import { jumpTo } from "../lib/focus.ts"
+import { accentText, BRAND } from "../lib/color.ts"
import PostContents from "../components/PostContents.tsx"
-import { headingAnchors, splitTabs, type PostTab } from "../lib/contents.ts"
+import { headingAnchors } from "../lib/contents.ts"
import QrCode from "../components/QrCode.tsx"
import RequestLink from "../components/RequestLink.tsx"
import { siteUrl } from "../lib/site.ts"
@@ -43,22 +34,6 @@ const BACK = { to: "/community#blog", label: "Community Blog" }
export default function BlogPost() {
const { id } = useParams()
const { data: post, loading, error, notFound, reload } = useBlogPost(id)
- const [tabIndex, setTabIndex] = useState(0)
- const reading = useReadingMode()
- const { hash } = useLocation()
-
- // A link into another tab (#tab-…) opens it, then goes to the heading.
- useEffect(() => {
- if (!post || !hash.startsWith("#tab-")) return
- const target = decodeURIComponent(hash.slice(1))
- const found = splitTabs(post.blocks).tabs
- const index = found.findIndex((tab) => target === tab.id || target.startsWith(tab.prefix))
- if (index < 0) return
- setTabIndex(index)
- // The tab's own id is its printed title, hidden on screen: opening
- // it is enough. A heading inside it is scrolled to once it shows.
- if (target !== found[index].id) requestAnimationFrame(() => jumpTo(target))
- }, [post, hash])
if (!post) {
return (
@@ -74,16 +49,8 @@ export default function BlogPost() {
)
}
- const { intro, tabs } = splitTabs(post.blocks)
- const current = Math.min(tabIndex, Math.max(tabs.length - 1, 0))
-
- // Two headings or more make a list worth showing: the intro's and
- // the open tab's.
- const contents = post.show_contents
- ? tabs.length
- ? [...headingAnchors(intro).entries, ...headingAnchors(tabs[current].blocks, tabs[current].prefix).entries]
- : headingAnchors(post.blocks).entries
- : []
+ // Two headings or more make a list worth showing.
+ const contents = post.show_contents ? headingAnchors(post.blocks).entries : []
const withContents = contents.length >= 2
const postUrl = siteUrl(`/blog/${post.id}`)
@@ -179,14 +146,7 @@ export default function BlogPost() {
/>
)}
- {tabs.length ? (
- <>
-
-
- >
- ) : (
-
- )}
+
Have a story to share?
@@ -230,86 +190,3 @@ export default function BlogPost() {
/>
)
}
-
-/* The post's tabs: a row of buttons, then the open tab's blocks. The
- others stay in the page, hidden, so print shows them all; `all`
- (reading mode) shows every tab, each under its title. */
-function PostTabs({
- tabs,
- current,
- onSelect,
- all,
-}: {
- tabs: PostTab[]
- current: number
- onSelect: (index: number) => void
- all: boolean
-}) {
- const baseId = useId()
-
- // Arrows move one tab and wrap; Home and End jump to the ends.
- const onKey = (e: KeyboardEvent) => {
- const last = tabs.length - 1
- const next =
- e.key === "ArrowRight" ? (current + 1) % tabs.length
- : e.key === "ArrowLeft" ? (current + last) % tabs.length
- : e.key === "Home" ? 0
- : e.key === "End" ? last
- : null
- if (next === null) return
- e.preventDefault()
- onSelect(next)
- document.getElementById(`${baseId}-tab-${next}`)?.focus()
- }
-
- return (
-
- >
- )
-}
-
-/* A tag's name, from its directory (asked once, and kept for its tab). */
-function TagName({ tag }: { tag: string }) {
- const { data } = useDirectory(tag)
- return <>{data?.name ?? tag}>
-}
diff --git a/src/pages/sections/home/HeroStage.tsx b/src/pages/sections/home/HeroStage.tsx
index a296858..45f58d5 100644
--- a/src/pages/sections/home/HeroStage.tsx
+++ b/src/pages/sections/home/HeroStage.tsx
@@ -19,11 +19,9 @@
video a featured video under a "Featured video" badge.
Never autoplays: an embed waits for play, a file
shows the browser's player
- event an event's card, under a "Featured event" badge
- from lg up (on a phone the card sits under the
- words and the badge is left out): its photo, dates,
- place and buttons. The API picks the event (pinned,
- else the countdown's)
+ event an event's card under a "Featured event" badge:
+ its photo, dates, place and buttons. The API picks
+ the event (pinned, else the countdown's)
A choice with nothing to show falls back: photos with no photos
to brand, a feature with no link set (or no event to show) to
@@ -127,12 +125,6 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
{feature === 'event' && hero?.event && (
- {/* Over the card it names, not over the headline beside it;
- on a phone the card under the words speaks for itself. */}
-