Pages: niche hero SETS (4 photographic heroes per niche served from /niches, thumbnail picker in the Look panel, design.hero index) + new Gaming niche

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-08 14:41:29 -05:00
parent f59b3d2771
commit 9f4c913ae6
33 changed files with 23 additions and 16 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ const href = u => { const s = String(u || '').trim(); return /^https?:\/\/[^\s"'
const PALETTE_NAMES = Object.keys(S.PALETTES).concat(['ink', 'ember']);
// the three knobs a page carries, with safe fallbacks for anything stored by older code
function knobs(page) { const d = page.design || {}; return { pk: S.paletteKey(d.palette), design: S.designKey(d.design), layout: S.layoutKey(d.layout), niche: S.nicheKey(d.niche) }; }
function knobs(page) { const d = page.design || {}; return { pk: S.paletteKey(d.palette), design: S.designKey(d.design), layout: S.layoutKey(d.layout), niche: S.nicheKey(d.niche), hero: d.hero }; }
function baseCss(k) {
const P = S.PALETTES[k.pk], C = P.c, dkGround = k.design === 'dark' || k.design === 'ignition';
@@ -49,7 +49,7 @@ function ctaBtn(c, extra) { const u = href(c && c.url); const t = esc((c && c.te
const headline = (k, t) => (k.design === 'ignition' ? S.blazeHeadline(t) : esc(t || ''));
// the visual on the right of a split: the member's image, else the niche hero, else the procedural card
function sideVisual(k, c) {
const img = href(c.image) || S.nicheHero(k.niche);
const img = href(c.image) || S.nicheHero(k.niche, k.hero);
if (img) return '<div class="media"><div class="k-imgframe"><img src="' + esc(img) + '" alt="' + esc(c.imageAlt || '') + '" loading="eager"></div></div>';
return '<div class="media">' + S.visualHtml(c.headline, c.bullets && c.bullets.length ? c.bullets : c.pros, c.price) + '</div>';
}
@@ -62,7 +62,7 @@ function formArea(page, opts) {
function render(page, opts) {
opts = opts || {}; const k = knobs(page); const c = page.content || {}; const split = k.layout === 'split';
const img = href(c.image) || S.nicheHero(k.niche);
const img = href(c.image) || S.nicheHero(k.niche, k.hero);
const head = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>' + esc(c.headline || page.title || 'Page') + '</title>'
+ '<meta name="description" content="' + esc((c.sub || '').slice(0, 160)) + '">' + (page.status !== 'published' ? '<meta name="robots" content="noindex,nofollow">' : '')
+ (img ? '<meta property="og:image" content="' + esc(img) + '">' : '') + '<meta property="og:title" content="' + esc(c.headline || page.title || '') + '"><meta property="og:description" content="' + esc((c.sub || '').slice(0, 200)) + '">'