website 1.12.0: three layouts for each page that lists something
- PAGE_VARIANTS: ministriesPage alternating/cards/list, leadershipPage grid/featured/list, eventsPage list/cards/months, messagesPage grid/featured/list, contactPage columns/map/cards. Kept in the design's variants beside the homepage sections', so each template recommends some and starts a new site on the first (its suggestion), PUT /design checks them, and a template switch moves an untouched one. - A design saved before has none: cleanDesign gives it LEGACY_PAGE_LAYOUTS (the look until now), and the site draws a snapshot without them the same way, so nothing changes until a church picks one. Contact's map layout without a place on the map draws as two columns. Ministries and messages keep their #slug anchors in every layout. - Admin: the layout at the top of a listing page in Pages, the suggestion marked; Template and style gets an Other pages tab with all five. - Tests: backend (156, five new); e2e page-layouts.spec.ts (every layout in every template, axe at phone and desktop; 60 passed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ import { demoChurch, demoParts, demoPeople } from '@crosscode/demo';
|
||||
import { markRemoved, notifyLinks, syncLink, type SyncResult } from '../feed/feed.js';
|
||||
import type { SectionData } from '../site/sections.js';
|
||||
import { publish } from '../site/snapshot.js';
|
||||
import { TEMPLATE_HEADERS, TEMPLATE_VARIANTS, SECTION_TYPES, defaultDesign, type SiteDesign } from '../site/variants.js';
|
||||
import { TEMPLATE_HEADERS, TEMPLATE_VARIANTS, LAYOUT_KEYS, defaultDesign, type SiteDesign } from '../site/variants.js';
|
||||
import { MAX_WIDTH, WIDTHS, processImage, type Sizes } from '../admin/media.js';
|
||||
import { DEMO_SEEDS, type DemoPhotos, type DemoSeed, type ProfileSeed } from './seeds.js';
|
||||
|
||||
@@ -250,7 +250,7 @@ const CLASSIC: Omit<DemoSeed, 'template'> & { pastorName: string; ctaText: strin
|
||||
export function seedDesign(template: WebsiteTemplate, alternate: boolean): SiteDesign {
|
||||
const design = defaultDesign(template);
|
||||
if (!alternate) return design;
|
||||
const variants = Object.fromEntries(SECTION_TYPES.map((s) => {
|
||||
const variants = Object.fromEntries(LAYOUT_KEYS.map((s) => {
|
||||
const options = TEMPLATE_VARIANTS[template][s] as readonly string[];
|
||||
return [s, options[1] ?? options[0]!];
|
||||
})) as SiteDesign['variants'];
|
||||
|
||||
Reference in New Issue
Block a user