@marktiderman/genesis-sites 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +74 -8
  2. package/SKILL.md +10 -0
  3. package/dist/assets/form-island.da6c662a73.js +51 -0
  4. package/dist/assets/{islands.33a445f34e.js → islands.83aaf5e0df.js} +1 -1
  5. package/dist/assets/sites-forms.bac9a6aafd.css +10 -0
  6. package/dist/assets/sites-forms.css +1 -1
  7. package/dist/assets/sites.323090ba26.css +2 -0
  8. package/dist/assets/sites.css +1 -1
  9. package/dist/assets.generated-YGLB7VKL.js +3 -0
  10. package/dist/{assets.generated-LLUGUUWZ.js.map → assets.generated-YGLB7VKL.js.map} +1 -1
  11. package/dist/blocks.js +2 -1
  12. package/dist/blocks.js.map +1 -1
  13. package/dist/{chunk-IU6AI75R.js → chunk-6CXTOPYI.js} +343 -158
  14. package/dist/chunk-6CXTOPYI.js.map +1 -0
  15. package/dist/{chunk-7E3YGYVH.js → chunk-FMQTSXJN.js} +26 -12
  16. package/dist/chunk-FMQTSXJN.js.map +1 -0
  17. package/dist/{chunk-SMJMXQ3T.js → chunk-I767PDBR.js} +260 -62
  18. package/dist/chunk-I767PDBR.js.map +1 -0
  19. package/dist/chunk-MXV2HOJO.js +19 -0
  20. package/dist/chunk-MXV2HOJO.js.map +1 -0
  21. package/dist/{chunk-KY4ALBVH.js → chunk-QE7KS2JS.js} +65 -7
  22. package/dist/chunk-QE7KS2JS.js.map +1 -0
  23. package/dist/{chunk-VJ4HOFBA.js → chunk-YAMQ2JKO.js} +20 -9
  24. package/dist/chunk-YAMQ2JKO.js.map +1 -0
  25. package/dist/editor.d.ts +22 -14
  26. package/dist/editor.js +701 -157
  27. package/dist/editor.js.map +1 -1
  28. package/dist/handler-J5BCH2VW.js +10 -0
  29. package/dist/{handler-UMGSZY33.js.map → handler-J5BCH2VW.js.map} +1 -1
  30. package/dist/import.d.ts +3 -3
  31. package/dist/index.d.ts +51 -10
  32. package/dist/index.js +3 -3
  33. package/dist/redirects-BNSD9MKa.d.ts +43 -0
  34. package/dist/{registry-BIijndsq.d.ts → registry-BPn-tDlL.d.ts} +75 -0
  35. package/dist/sections.d.ts +86 -4
  36. package/dist/sections.js +2 -2
  37. package/dist/{store-BImtGmoF.d.ts → store-B_GMH42V.d.ts} +2 -2
  38. package/dist/supabase.d.ts +4 -4
  39. package/dist/supabase.js +3 -3
  40. package/dist/{templates-kA-jrnWA.d.ts → templates-CFSSG1iU.d.ts} +2 -2
  41. package/dist/templates.d.ts +3 -3
  42. package/dist/{theme-Cg-inpk5.d.ts → theme-Dw42GDI_.d.ts} +1 -1
  43. package/dist/web.d.ts +21 -11
  44. package/dist/web.js +5 -5
  45. package/migrations/0003_genesis_sites_post_dates.sql +117 -0
  46. package/migrations/tests/0003_genesis_sites_post_dates.test.sql +76 -0
  47. package/package.json +9 -5
  48. package/dist/assets/form-island.defb8daccc.js +0 -51
  49. package/dist/assets/sites-forms.aff23b5617.css +0 -10
  50. package/dist/assets/sites.5b3f64c627.css +0 -2
  51. package/dist/assets.generated-LLUGUUWZ.js +0 -3
  52. package/dist/chunk-7E3YGYVH.js.map +0 -1
  53. package/dist/chunk-IU6AI75R.js.map +0 -1
  54. package/dist/chunk-KY4ALBVH.js.map +0 -1
  55. package/dist/chunk-RLYO6VVP.js +0 -19
  56. package/dist/chunk-RLYO6VVP.js.map +0 -1
  57. package/dist/chunk-SMJMXQ3T.js.map +0 -1
  58. package/dist/chunk-VJ4HOFBA.js.map +0 -1
  59. package/dist/handler-UMGSZY33.js +0 -10
@@ -1,11 +1,12 @@
1
- import { brandDisplayName } from './chunk-VJ4HOFBA.js';
2
- import { DEFAULT_RESERVED_PATHS, pagePathProblems } from './chunk-MU2Z2C4F.js';
1
+ import { brandDisplayName } from './chunk-YAMQ2JKO.js';
2
+ import { isNotFoundPage, NOT_FOUND_PATH, redirectLoops } from './chunk-6CXTOPYI.js';
3
+ import { DEFAULT_RESERVED_PATHS, pagePathProblems, isSafeHref } from './chunk-MU2Z2C4F.js';
3
4
 
4
5
  // src/core/landing.ts
5
6
  var DEFAULT_LANDING_DIRECTORY = "/go";
6
7
  var LANDING_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
7
- function landingDirectory(site) {
8
- return site?.landing?.directory ?? DEFAULT_LANDING_DIRECTORY;
8
+ function landingDirectory(site, fallback) {
9
+ return site?.landing?.directory ?? fallback ?? DEFAULT_LANDING_DIRECTORY;
9
10
  }
10
11
  function landingPath(directory, slug) {
11
12
  return `${directory}/${slug}`;
@@ -39,6 +40,63 @@ function landingMoves(pages, from, to) {
39
40
  return moves;
40
41
  }
41
42
 
43
+ // src/core/redirects.ts
44
+ function redirectDestinations(pages, extra = []) {
45
+ const own = [];
46
+ for (const p of pages) if (!isNotFoundPage(p) && !isLandingPage(p)) own.push({ group: "Pages", label: p.title, path: p.path });
47
+ for (const p of pages) if (isLandingPage(p)) own.push({ group: "Landing pages", label: p.title, path: p.path });
48
+ const seen = /* @__PURE__ */ new Set();
49
+ return [...own, ...extra].filter((d) => seen.has(d.path) ? false : (seen.add(d.path), true));
50
+ }
51
+ function sitePathOf(to) {
52
+ if (!to.startsWith("/")) return null;
53
+ const path = to.split(/[?#]/)[0];
54
+ return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
55
+ }
56
+ function redirectFromProblems(from, ctx, how = {}) {
57
+ const problems = pagePathProblems(from, ctx.reserved ?? DEFAULT_RESERVED_PATHS).map((p) => p.replace(/^A page path/, "The old address"));
58
+ if (from === "/") problems.push("The home page can't redirect.");
59
+ if (from === NOT_FOUND_PATH) problems.push(`${NOT_FOUND_PATH} is the site's 404 page and can't redirect.`);
60
+ if (how.match !== "prefix" && ctx.pages.some((p) => p.path === from)) problems.push(`A page is at ${from}; a redirect there would hide it.`);
61
+ if (from !== ctx.editing && ctx.redirects.some((r) => r.from === from)) problems.push(`${from} already redirects.`);
62
+ return problems;
63
+ }
64
+ function redirectToProblems(from, to, ctx, how = {}) {
65
+ if (!to) return ["Choose where it goes."];
66
+ if (!isSafeHref(to) || to.startsWith("#")) return ["Use a site path (/about) or a full https link."];
67
+ const target = sitePathOf(to);
68
+ if (target === from) return ["A redirect can't go to its own address."];
69
+ if (how.match === "prefix" && target !== null && target.startsWith(`${from}/`)) return [`${to} is under ${from} itself, so it would redirect again.`];
70
+ if (how.keepRest && how.match !== "prefix") return ["Keeping the rest of the address needs everything under the old address."];
71
+ if (how.keepRest && target === null) return ["Keeping the rest of the address needs a site path (/team), not a full link."];
72
+ const onward = target === null ? void 0 : ctx.redirects.find((r) => r.from === target && r.from !== ctx.editing);
73
+ if (onward) return [`${target} redirects to ${onward.to} itself; choose ${onward.to} instead.`];
74
+ const after = upsertRedirect(ctx.redirects, { from, to, status: 301, ...how.match ? { match: how.match } : {}, ...how.keepRest ? { keepRest: true } : {} }, ctx.editing);
75
+ const pages = new Set(ctx.pages.map((p) => p.path));
76
+ if (redirectLoops(after, (p) => pages.has(p)).length) return [`Visitors would go round in circles: following the redirects from ${from} comes back to an address they passed.`];
77
+ return [];
78
+ }
79
+ function upsertRedirect(redirects, next, replacing) {
80
+ const out = [];
81
+ let placed = false;
82
+ for (const r of redirects) {
83
+ if (r.from === replacing || r.from === next.from) {
84
+ if (!placed) out.push(next);
85
+ placed = true;
86
+ continue;
87
+ }
88
+ const target = sitePathOf(next.to);
89
+ const catchesItself = r.match === "prefix" && target !== null && (target === r.from || target.startsWith(`${r.from}/`));
90
+ const pointed = sitePathOf(r.to) === next.from && !catchesItself ? { ...r, to: next.to } : r;
91
+ if (sitePathOf(pointed.to) !== pointed.from) out.push(pointed);
92
+ }
93
+ if (!placed) out.push(next);
94
+ return out;
95
+ }
96
+ function removeRedirect(redirects, from) {
97
+ return redirects.filter((r) => r.from !== from);
98
+ }
99
+
42
100
  // src/core/templates.ts
43
101
  var year = () => (/* @__PURE__ */ new Date()).getUTCFullYear();
44
102
  function node(id, type, variant, props, extra = {}) {
@@ -284,6 +342,6 @@ var exampleBrands = Object.freeze({
284
342
  }
285
343
  });
286
344
 
287
- export { DEFAULT_LANDING_DIRECTORY, LANDING_SLUG, exampleBrands, isLandingPage, landingDirectory, landingDirectoryProblems, landingMoves, landingPage, landingPages, landingPath, landingSlugOf, landingSlugProblems, onePageSite, starterSite };
288
- //# sourceMappingURL=chunk-KY4ALBVH.js.map
289
- //# sourceMappingURL=chunk-KY4ALBVH.js.map
345
+ export { DEFAULT_LANDING_DIRECTORY, LANDING_SLUG, exampleBrands, isLandingPage, landingDirectory, landingDirectoryProblems, landingMoves, landingPage, landingPages, landingPath, landingSlugOf, landingSlugProblems, onePageSite, redirectDestinations, redirectFromProblems, redirectToProblems, removeRedirect, starterSite, upsertRedirect };
346
+ //# sourceMappingURL=chunk-QE7KS2JS.js.map
347
+ //# sourceMappingURL=chunk-QE7KS2JS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/landing.ts","../src/core/redirects.ts","../src/core/templates.ts","../src/core/examples.ts"],"names":[],"mappings":";;;;;AAUO,IAAM,yBAAA,GAA4B;AAGlC,IAAM,YAAA,GAAe;AAGrB,SAAS,gBAAA,CAAiB,MAAmD,QAAA,EAA2B;AAC7G,EAAA,OAAO,IAAA,EAAM,OAAA,EAAS,SAAA,IAAa,QAAA,IAAY,yBAAA;AACjD;AAGO,SAAS,WAAA,CAAY,WAAmB,IAAA,EAAsB;AACnE,EAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAC7B;AAGO,SAAS,aAAA,CAAc,WAAmB,IAAA,EAA6B;AAC5E,EAAA,MAAM,MAAA,GAAS,GAAG,SAAS,CAAA,CAAA,CAAA;AAC3B,EAAA,IAAI,CAAC,KAAK,UAAA,CAAW,MAAM,KAAK,IAAA,CAAK,MAAA,KAAW,MAAA,CAAO,MAAA,EAAQ,OAAO,IAAA;AACtE,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,MAA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AA,EAAS,WAAW,IAAI,CAAA,CAAA,EAAI,UAAA,EAAY,KAAA,CAAM,OAAA,EAAS,KAAA,GAAQ,EAAE,KAAA,EAAO,YAAY,IAAA,EAAM,CAAA,OAAA,EAAU,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,CAAA,EAAG,GAAI,GAAA,EAAK,CAAC;AAAA,WAC5L;AAAA,UACA,gBAAgB,IAAI,CAAA,CAAA;AAAA;AACtB;AACF;AACF,GACF;AACF;;;AClTO,IAAM,aAAA,GAAgB,OAAO,MAAA,CAAO;AAAA,EACzC,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,iBAAA;AAAA,IACN,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,SAAA,EAAU;AAAA,IACrD,KAAA,EAAO,EAAE,OAAA,EAAS,eAAA,EAAiB,MAAM,OAAA;AAAQ,GACnD;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,oBAAA;AAAA,IACN,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,SAAA,EAAU;AAAA,IACrD,KAAA,EAAO,EAAE,OAAA,EAAS,kBAAA,EAAoB,MAAM,WAAA;AAAY;AAE5D,CAAqC","file":"chunk-QE7KS2JS.js","sourcesContent":["/**\n * Landing pages: the site's campaign pages (kind `landing`), made under one\n * directory (`/go` unless the site's `landing.directory` says otherwise) and\n * kept out of the menu. They are ordinary pages otherwise: the same\n * document, editor, checks, preview and release.\n */\nimport type { PageMeta, SiteDoc } from \"./schemas\";\nimport { DEFAULT_RESERVED_PATHS, pagePathProblems, type ReservedPaths } from \"./urls\";\n\n/** Where new landing pages go when the site doesn't say. */\nexport const DEFAULT_LANDING_DIRECTORY = \"/go\";\n\n/** A landing page's slug: one path segment of lowercase letters, digits and single hyphens. */\nexport const LANDING_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/** The site's landing page directory: `site.landing.directory`, else `fallback` (the host's default), else `/go`. */\nexport function landingDirectory(site: Pick<SiteDoc, \"landing\"> | null | undefined, fallback?: string): string {\n return site?.landing?.directory ?? fallback ?? DEFAULT_LANDING_DIRECTORY;\n}\n\n/** The path of the landing page `slug` under `directory`: `(\"/go\", \"spring\")` → `/go/spring`. */\nexport function landingPath(directory: string, slug: string): string {\n return `${directory}/${slug}`;\n}\n\n/** The slug of a page under `directory` (`/go/spring` → `spring`), or null for a path outside it. */\nexport function landingSlugOf(directory: string, path: string): string | null {\n const prefix = `${directory}/`;\n if (!path.startsWith(prefix) || path.length === prefix.length) return null;\n return path.slice(prefix.length);\n}\n\n/** Why `directory` can't hold landing pages (empty when it can): a page path other than `/`, and not reserved. */\nexport function landingDirectoryProblems(directory: unknown, reserved: ReservedPaths = DEFAULT_RESERVED_PATHS): string[] {\n if (directory === \"/\") return [\"Landing pages need a directory of their own (like /go), not /.\"];\n return pagePathProblems(directory, reserved).map((p) => p.replace(/^A page path/, \"A landing page directory\"));\n}\n\n/** Why `slug` can't name a landing page under `directory` (empty when it can). */\nexport function landingSlugProblems(directory: string, slug: string, reserved: ReservedPaths = DEFAULT_RESERVED_PATHS): string[] {\n if (!LANDING_SLUG.test(slug)) return [\"A landing page's address ends in lowercase letters, digits and single hyphens (for example spring-offer).\"];\n return pagePathProblems(landingPath(directory, slug), reserved);\n}\n\n/**\n * Is this one of the site's landing pages? A page of kind `landing`, except\n * the home page: a one-click landing site's `/` is the site's home page, and\n * stays among the pages.\n */\nexport function isLandingPage(page: Pick<PageMeta, \"kind\" | \"path\">): boolean {\n return page.kind === \"landing\" && page.path !== \"/\";\n}\n\n/** The site's landing pages (`isLandingPage`), in the store's order. */\nexport function landingPages<T extends Pick<PageMeta, \"kind\" | \"path\">>(pages: readonly T[]): T[] {\n return pages.filter(isLandingPage);\n}\n\n/**\n * Where each landing page under `from` goes when the directory becomes `to`:\n * `/go/spring` → `/offers/spring`. Pages outside `from` stay where they are.\n */\nexport function landingMoves<T extends Pick<PageMeta, \"id\" | \"kind\" | \"path\">>(pages: readonly T[], from: string, to: string): { page: T; path: string }[] {\n if (from === to) return [];\n const moves: { page: T; path: string }[] = [];\n for (const page of landingPages(pages)) {\n const slug = landingSlugOf(from, page.path);\n if (slug !== null) moves.push({ page, path: landingPath(to, slug) });\n }\n return moves;\n}\n","/**\n * Redirects an editor adds by hand: an old or short address on the site that\n * sends visitors somewhere else, permanently (301) or for now (302). The\n * destination is one of the site's own pages or landing pages, a place the\n * host app offers (`RedirectDestination`, a form or an offer, say), or any\n * other address. Page moves add their own redirects (`redirectsAfterMove`);\n * these helpers keep the same rules: one redirect per address, never from a\n * page's address or a reserved one, and no chains.\n */\nimport { isLandingPage } from \"./landing\";\nimport { isNotFoundPage, NOT_FOUND_PATH } from \"./not-found\";\nimport type { PageMeta, Redirect } from \"./schemas\";\nimport { redirectLoops } from \"./seo\";\nimport { DEFAULT_RESERVED_PATHS, isSafeHref, pagePathProblems, type ReservedPaths } from \"./urls\";\n\n/**\n * A place a redirect can go, offered in the editor's picker: `path` is a site\n * path (`/f/feedback`) or a full URL, `label` names it, and `group` is the\n * heading it is listed under (\"Forms\", \"Offers\").\n */\nexport interface RedirectDestination {\n group: string;\n label: string;\n path: string;\n}\n\n/** The site's own pages and landing pages as destinations, then the host's (`extra`), each path once. */\nexport function redirectDestinations(pages: readonly Pick<PageMeta, \"path\" | \"title\" | \"kind\">[], extra: readonly RedirectDestination[] = []): RedirectDestination[] {\n const own: RedirectDestination[] = [];\n for (const p of pages) if (!isNotFoundPage(p) && !isLandingPage(p)) own.push({ group: \"Pages\", label: p.title, path: p.path });\n for (const p of pages) if (isLandingPage(p)) own.push({ group: \"Landing pages\", label: p.title, path: p.path });\n const seen = new Set<string>();\n return [...own, ...extra].filter((d) => (seen.has(d.path) ? false : (seen.add(d.path), true)));\n}\n\n/** The path a site-path destination names, without its query or fragment; null for a full URL. */\nfunction sitePathOf(to: string): string | null {\n if (!to.startsWith(\"/\")) return null;\n const path = to.split(/[?#]/)[0]!;\n return path.length > 1 && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n}\n\nexport interface RedirectContext {\n /** The site's redirects now. */\n redirects: readonly Redirect[];\n /** The site's pages: a redirect can't take a page's address. */\n pages: readonly Pick<PageMeta, \"path\">[];\n reserved?: ReservedPaths | undefined;\n /** The address of the redirect being edited, which may keep it. */\n editing?: string | undefined;\n}\n\n/** Why a redirect can't be from `from` (empty when it can). */\nexport function redirectFromProblems(from: string, ctx: RedirectContext, how: RedirectMatch = {}): string[] {\n const problems = pagePathProblems(from, ctx.reserved ?? DEFAULT_RESERVED_PATHS).map((p) => p.replace(/^A page path/, \"The old address\"));\n if (from === \"/\") problems.push(\"The home page can't redirect.\");\n if (from === NOT_FOUND_PATH) problems.push(`${NOT_FOUND_PATH} is the site's 404 page and can't redirect.`);\n // Pages win over a prefix redirect, so only an exact one would hide the page at its address.\n if (how.match !== \"prefix\" && ctx.pages.some((p) => p.path === from)) problems.push(`A page is at ${from}; a redirect there would hide it.`);\n if (from !== ctx.editing && ctx.redirects.some((r) => r.from === from)) problems.push(`${from} already redirects.`);\n return problems;\n}\n\n/** How a redirect matches: its `from` only, or everything under it too. */\nexport interface RedirectMatch {\n match?: \"prefix\" | undefined;\n keepRest?: boolean | undefined;\n}\n\n/** Why a redirect from `from` can't go to `to` (empty when it can). */\nexport function redirectToProblems(from: string, to: string, ctx: RedirectContext, how: RedirectMatch = {}): string[] {\n if (!to) return [\"Choose where it goes.\"];\n if (!isSafeHref(to) || to.startsWith(\"#\")) return [\"Use a site path (/about) or a full https link.\"];\n const target = sitePathOf(to);\n if (target === from) return [\"A redirect can't go to its own address.\"];\n if (how.match === \"prefix\" && target !== null && target.startsWith(`${from}/`)) return [`${to} is under ${from} itself, so it would redirect again.`];\n if (how.keepRest && how.match !== \"prefix\") return [\"Keeping the rest of the address needs everything under the old address.\"];\n if (how.keepRest && target === null) return [\"Keeping the rest of the address needs a site path (/team), not a full link.\"];\n const onward = target === null ? undefined : ctx.redirects.find((r) => r.from === target && r.from !== ctx.editing);\n if (onward) return [`${target} redirects to ${onward.to} itself; choose ${onward.to} instead.`];\n // Through the other redirects (an address under a prefix one, say) it may still come back here.\n const after = upsertRedirect(ctx.redirects, { from, to, status: 301, ...(how.match ? { match: how.match } : {}), ...(how.keepRest ? { keepRest: true } : {}) }, ctx.editing);\n const pages = new Set(ctx.pages.map((p) => p.path));\n if (redirectLoops(after, (p) => pages.has(p)).length) return [`Visitors would go round in circles: following the redirects from ${from} comes back to an address they passed.`];\n return [];\n}\n\n/**\n * The redirects with `next` added, or put in place of the one from `replacing`.\n * Redirects that went to `next.from` go straight to `next.to` (no chains),\n * and any left pointing at their own address are dropped.\n */\nexport function upsertRedirect(redirects: readonly Redirect[], next: Redirect, replacing?: string): Redirect[] {\n const out: Redirect[] = [];\n let placed = false;\n for (const r of redirects) {\n if (r.from === replacing || r.from === next.from) {\n if (!placed) out.push(next);\n placed = true;\n continue;\n }\n // Point straight at the new destination, unless that is under the redirect's own prefix (it would catch itself).\n const target = sitePathOf(next.to);\n const catchesItself = r.match === \"prefix\" && target !== null && (target === r.from || target.startsWith(`${r.from}/`));\n const pointed = sitePathOf(r.to) === next.from && !catchesItself ? { ...r, to: next.to } : r;\n if (sitePathOf(pointed.to) !== pointed.from) out.push(pointed);\n }\n if (!placed) out.push(next);\n return out;\n}\n\n/** The redirects without the one from `from`. */\nexport function removeRedirect(redirects: readonly Redirect[], from: string): Redirect[] {\n return redirects.filter((r) => r.from !== from);\n}\n","/**\n * Templates: whole sites from a little input.\n *\n * - `landingPage`: the one-click landing page from a brand and a message.\n * Nav, hero, features, testimonials, a call to action, a form embed and a\n * footer, on one page.\n * - `onePageSite`: the smallest site a brand with no site can be seeded\n * with: just a name, a logo, a message, and the brand's colours and fonts.\n * - `starterSite`: three pages (home, about, contact) with nav and footer.\n *\n * Each returns documents (`site`, `pages`) for any `SiteStore` to create.\n * Nothing is invented and passed off as real: copy a template can't know\n * (a client's quote, a statistic) is marked `placeholder`, and the publish\n * check refuses it until someone replaces it or hides the section.\n */\nimport type { Link, PageDoc, PageKind, SectionNode, SiteDocInput } from \"./schemas\";\nimport { brandDisplayName, type BrandInput, type SiteBrand } from \"./theme\";\n\nexport interface TemplateMessage {\n /** The hero's headline: what you do, for whom. */\n headline: string;\n /** One or two sentences under it. */\n subhead?: string;\n /** The main button. Default: \"Get in touch\", to the form (or `#contact`). */\n cta?: Link;\n /** What you offer, as the features band. Without it the band is a placeholder to fill in. */\n benefits?: { title: string; body: string }[];\n}\n\nexport interface TemplateInput {\n brand: BrandInput;\n message: TemplateMessage;\n /** A form to embed (its slug, for the host's forms resolver). */\n form?: { slug: string; heading?: string; body?: string };\n /** For the footer. */\n contact?: { email?: string; phone?: string };\n}\n\nexport interface TemplateResult {\n site: SiteDocInput;\n pages: { path: string; kind: PageKind; doc: PageDoc }[];\n}\n\nconst year = () => new Date().getUTCFullYear();\n\nfunction node(id: string, type: string, variant: string, props: Record<string, unknown>, extra: Partial<SectionNode> = {}): SectionNode {\n return { id, type, v: 1, variant, props, ...extra };\n}\n\nfunction footerNode(name: string, contact: TemplateInput[\"contact\"], variant = \"simple\"): SectionNode {\n const links: Link[] = [];\n if (contact?.email) links.push({ label: contact.email, href: `mailto:${contact.email}` });\n if (contact?.phone) links.push({ label: contact.phone, href: `tel:${contact.phone.replace(/[^+\\d]/g, \"\")}` });\n return node(\"footer\", \"footer\", variant, {\n ...(links.length ? { links } : {}),\n copyright: `© ${year()} ${name}`,\n });\n}\n\nfunction seo(name: string, message: TemplateMessage) {\n return {\n titleTemplate: `%s · ${name}`,\n ...(message.subhead ? { description: message.subhead.slice(0, 200) } : {}),\n organization: { name },\n };\n}\n\nfunction primaryCta(input: TemplateInput): Link {\n return input.message.cta ?? { label: \"Get in touch\", href: \"#contact\" };\n}\n\nfunction benefitsNode(message: TemplateMessage): SectionNode {\n if (message.benefits?.length) {\n return node(\"features\", \"features\", \"grid\", {\n heading: \"What you get\",\n items: message.benefits.slice(0, 12).map((b, i) => ({ title: b.title, body: b.body, icon: ([\"check\", \"star\", \"heart\", \"zap\", \"shield\", \"clock\"] as const)[i % 6] })),\n });\n }\n return node(\n \"features\",\n \"features\",\n \"grid\",\n {\n heading: \"What you get\",\n items: [\n { title: \"Your first offer\", body: \"Say what someone gets and why it matters to them.\", icon: \"check\" },\n { title: \"Your second offer\", body: \"Keep each one to a sentence or two.\", icon: \"star\" },\n { title: \"Your third offer\", body: \"Three is plenty for a landing page.\", icon: \"heart\" },\n ],\n },\n { placeholder: true },\n );\n}\n\nconst testimonialsNode = () =>\n node(\n \"testimonials\",\n \"testimonials\",\n \"grid\",\n {\n heading: \"What people say\",\n items: [\n { quote: \"Add a quote from someone you have helped, in their words and with their permission.\", name: \"Their name\", role: \"What they did with you\" },\n { quote: \"A second quote, from someone different.\", name: \"Their name\" },\n ],\n },\n { placeholder: true },\n );\n\nfunction formNode(input: TemplateInput): SectionNode | null {\n if (!input.form) return null;\n return node(\"contact\", \"form-embed\", \"split\", {\n heading: input.form.heading ?? \"Get in touch\",\n ...(input.form.body ? { body: input.form.body } : { body: \"Tell us a little about yourself and we'll get back to you.\" }),\n form: input.form.slug,\n anchor: \"contact\",\n });\n}\n\n/**\n * The one-click landing page: brand plus message, on one page.\n *\n * @stability Beta\n */\nexport function landingPage(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta = primaryCta(input);\n const form = formNode(input);\n const content: SectionNode[] = [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Ready when you are\", primaryCta: cta, surface: \"accent\" }),\n ];\n if (form) content.push(form);\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(name, input.contact, \"minimal\")],\n seo: seo(name, input.message),\n },\n pages: [{ path: \"/\", kind: \"landing\", doc: { schemaVersion: 1, root: { props: { title: input.message.headline.slice(0, 120) } }, content, seo: input.message.subhead ? { description: input.message.subhead.slice(0, 200) } : undefined } }],\n };\n}\n\nexport interface OnePageSiteInput {\n name: string;\n logo?: { src: string; alt?: string };\n message: TemplateMessage;\n /** The brand's colours and fonts. */\n colors: SiteBrand[\"colors\"];\n fonts?: SiteBrand[\"fonts\"];\n contact?: TemplateInput[\"contact\"];\n}\n\n/**\n * The smallest site, for seeding a brand that has none: a header, a hero,\n * a call to action and a footer. `brand` is the minimal brand to store\n * beside it (the host's `BrandSource` returns it).\n *\n * @stability Beta\n */\nexport function onePageSite(input: OnePageSiteInput): TemplateResult & { brand: SiteBrand } {\n const brand: SiteBrand = { name: input.name, colors: input.colors, ...(input.fonts ? { fonts: input.fonts } : {}), ...(input.logo ? { logo: input.logo } : {}) };\n const cta = input.message.cta ?? (input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : { label: \"Get in touch\", href: \"#contact\" });\n return {\n brand,\n site: {\n schemaVersion: 1,\n name: input.name,\n header: [node(\"nav\", \"nav\", \"minimal\", { cta })],\n nav: [],\n footer: [footerNode(input.name, input.contact)],\n seo: seo(input.name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: {\n schemaVersion: 1,\n root: { props: { title: input.message.headline.slice(0, 120) } },\n content: [\n node(\"hero\", \"hero\", \"centered\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n }),\n node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${input.name}`, primaryCta: cta, anchor: \"contact\" }),\n ],\n ...(input.message.subhead ? { seo: { description: input.message.subhead.slice(0, 200) } } : {}),\n },\n },\n ],\n };\n}\n\n/**\n * A three-page starter site: home, about and contact, with the menu, a\n * footer and redirects-ready paths.\n *\n * @stability Beta\n */\nexport function starterSite(input: TemplateInput): TemplateResult {\n const name = brandDisplayName(input.brand);\n const cta: Link = input.message.cta ?? { label: \"Contact us\", href: \"/contact\" };\n const form = formNode(input);\n const page = (title: string, content: SectionNode[], description?: string): PageDoc => ({\n schemaVersion: 1,\n root: { props: { title } },\n content,\n ...(description ? { seo: { description } } : {}),\n });\n return {\n site: {\n schemaVersion: 1,\n name,\n header: [node(\"nav\", \"nav\", \"simple\", { cta })],\n nav: [\n { label: \"Home\", href: \"/\" },\n { label: \"About\", href: \"/about\" },\n { label: \"Contact\", href: \"/contact\" },\n ],\n footer: [\n node(\"footer\", \"footer\", \"columns\", {\n tagline: input.message.subhead?.slice(0, 200),\n columns: [\n { heading: name, links: [{ label: \"About\", href: \"/about\" }, { label: \"Contact\", href: \"/contact\" }] },\n ...(input.contact?.email || input.contact?.phone\n ? [\n {\n heading: \"Get in touch\",\n links: [\n ...(input.contact.email ? [{ label: input.contact.email, href: `mailto:${input.contact.email}` }] : []),\n ...(input.contact.phone ? [{ label: input.contact.phone, href: `tel:${input.contact.phone.replace(/[^+\\d]/g, \"\")}` }] : []),\n ],\n },\n ]\n : []),\n ],\n copyright: `© ${year()} ${name}`,\n }),\n ],\n seo: seo(name, input.message),\n },\n pages: [\n {\n path: \"/\",\n kind: \"page\",\n doc: page(\n \"Home\",\n [\n node(\"hero\", \"hero\", \"split\", {\n heading: input.message.headline,\n ...(input.message.subhead ? { body: input.message.subhead } : {}),\n primaryCta: cta,\n secondaryCta: { label: \"About us\", href: \"/about\" },\n }),\n benefitsNode(input.message),\n testimonialsNode(),\n node(\"cta\", \"cta\", \"banner\", { heading: \"Come and see for yourself\", primaryCta: cta, surface: \"accent\" }),\n ],\n input.message.subhead?.slice(0, 200),\n ),\n },\n {\n path: \"/about\",\n kind: \"page\",\n doc: page(\n \"About\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"About\", heading: `About ${name}` }),\n node(\n \"story\",\n \"rich-text\",\n \"narrow\",\n {\n body: {\n type: \"doc\",\n content: [\n { type: \"heading\", attrs: { level: 2 }, content: [{ type: \"text\", text: \"Our story\" }] },\n { type: \"paragraph\", content: [{ type: \"text\", text: \"Tell people how you started, who you help and what you believe.\" }] },\n ],\n },\n },\n { placeholder: true },\n ),\n ],\n `About ${name}.`,\n ),\n },\n {\n path: \"/contact\",\n kind: \"page\",\n doc: page(\n \"Contact\",\n [\n node(\"hero\", \"hero\", \"centered\", { eyebrow: \"Contact\", heading: \"Get in touch\", ...(input.message.subhead ? { body: input.message.subhead } : {}) }),\n ...(form ? [form] : [node(\"contact\", \"cta\", \"card\", { heading: `Talk to ${name}`, primaryCta: input.contact?.email ? { label: \"Email us\", href: `mailto:${input.contact.email}` } : cta })]),\n ],\n `How to reach ${name}.`,\n ),\n },\n ],\n };\n}\n","/**\n * Made-up brands for demos, tests and docs. They are not anyone's real\n * business.\n */\nimport type { SiteBrand } from \"./theme\";\n\nexport const exampleBrands = Object.freeze({\n riverside: {\n name: \"Riverside Works\",\n colors: { primary: \"#0f766e\", primaryDark: \"#2dd4bf\" },\n fonts: { heading: \"space-grotesk\", body: \"inter\" },\n },\n hilltop: {\n name: \"Hilltop Collective\",\n colors: { primary: \"#b45309\", primaryDark: \"#fbbf24\" },\n fonts: { heading: \"playfair-display\", body: \"work-sans\" },\n },\n} satisfies Record<string, SiteBrand>);\n"]}
@@ -1,4 +1,4 @@
1
- import { getSection, PostSlug, PostDoc, ReleaseSnapshot, validatePostSlug, MAX_IMPORT_POSTS, MAX_LIVE_POSTS, postSummary, redirectsAfterMove, PageDoc, SiteDoc } from './chunk-IU6AI75R.js';
1
+ import { getSection, redirectLoops, PostSlug, PostDoc, ReleaseSnapshot, validatePostSlug, MAX_IMPORT_POSTS, MAX_LIVE_POSTS, postSummary, redirectsAfterMove, PageDoc, SiteDoc } from './chunk-6CXTOPYI.js';
2
2
  import { pagePathProblems, isReservedPath, DEFAULT_RESERVED_PATHS, validatePagePath } from './chunk-MU2Z2C4F.js';
3
3
  import { FONT_CHOICES, genesisBrand, themeFromBrand } from '@marktiderman/genesis-design-system';
4
4
  export { FONT_CHOICES } from '@marktiderman/genesis-design-system';
@@ -454,7 +454,11 @@ function checkSiteDoc(site, lookup = getSection) {
454
454
  for (const r of site.redirects) {
455
455
  if (froms.has(r.from)) issues.push({ severity: "error", code: "redirect-duplicate", path: r.from, message: `Two redirects from ${r.from}.` });
456
456
  froms.add(r.from);
457
- if (r.to === r.from) issues.push({ severity: "error", code: "redirect-loop", path: r.from, message: `The redirect from ${r.from} points at itself.` });
457
+ const target = r.to.split(/[?#]/)[0];
458
+ const loops = r.match === "prefix" ? r.to.startsWith("/") && (target === r.from || target.startsWith(`${r.from}/`)) : r.to === r.from;
459
+ if (loops) issues.push({ severity: "error", code: "redirect-loop", path: r.from, message: `The redirect from ${r.from} points at itself.` });
460
+ if (r.match === "prefix" && r.from === "/") issues.push({ severity: "error", code: "redirect-prefix-home", path: r.from, message: "A redirect from everything under / would replace the whole site." });
461
+ if (r.keepRest && r.match !== "prefix") issues.push({ severity: "error", code: "redirect-keep-rest", path: r.from, message: `The redirect from ${r.from} keeps the rest of the address but matches only ${r.from}.` });
458
462
  }
459
463
  return issues;
460
464
  }
@@ -477,10 +481,17 @@ function checkRelease(snapshot, options = {}) {
477
481
  }
478
482
  if (!paths.has("/")) issues.push({ severity: "error", code: "no-home", message: "The site has no home page (a page at /)." });
479
483
  issues.push(...checkBlog(snapshot, lookup));
484
+ const postBase = snapshot.pages.find((p) => p.kind === "post")?.path;
485
+ const mayBePost = (p) => postBase !== void 0 && p.startsWith(`${postBase === "/" ? "" : postBase}/`);
486
+ const selfLoops = new Set(issues.filter((i) => i.code === "redirect-loop").map((i) => i.path));
487
+ for (const from of redirectLoops(snapshot.site.redirects, (p) => paths.has(p) || mayBePost(p))) {
488
+ if (!selfLoops.has(from)) issues.push({ severity: "error", code: "redirect-loop", path: from, message: `Following the redirect from ${from} comes back to an address it passed (or never ends): visitors would never arrive.` });
489
+ }
480
490
  for (const r of snapshot.site.redirects) {
481
- if (paths.has(r.from)) issues.push({ severity: "error", code: "redirect-shadows-page", path: r.from, message: `The redirect from ${r.from} hides the page there; remove the redirect.` });
491
+ if (r.match !== "prefix" && paths.has(r.from)) issues.push({ severity: "error", code: "redirect-shadows-page", path: r.from, message: `The redirect from ${r.from} hides the page there; remove the redirect.` });
482
492
  const target = r.to.split(/[?#]/)[0];
483
- if (r.to.startsWith("/") && !paths.has(target)) {
493
+ const appPath = options.reserved !== void 0 ? isReservedPath(target, options.reserved) : isReservedPath(target);
494
+ if (r.to.startsWith("/") && !r.keepRest && !paths.has(target) && !appPath) {
484
495
  issues.push({ severity: "warning", code: "redirect-to-missing-page", path: r.from, message: `The redirect from ${r.from} goes to ${target}, where there's no page (was it deleted?).` });
485
496
  }
486
497
  if (options.reserved !== void 0 ? isReservedPath(r.from, options.reserved) : isReservedPath(r.from)) {
@@ -960,7 +971,7 @@ function createMemorySiteStore(options = {}) {
960
971
  if (!input.id) {
961
972
  if (sitePosts(siteId).some((p2) => p2.slug === input.slug)) throw new Error(`A post is already at ${input.slug}.`);
962
973
  const postId = id("post");
963
- posts.set(postId, { id: postId, siteId, slug: input.slug, doc, rev: 1, status: "draft", published: null, publishedAt: null, updatedAt: at, deleted: false });
974
+ posts.set(postId, { id: postId, siteId, slug: input.slug, doc, rev: 1, status: "draft", published: null, publishedAt: null, importedPublishedAt: null, updatedAt: at, deleted: false });
964
975
  return { id: postId, rev: 1 };
965
976
  }
966
977
  const p = editablePost(input.id);
@@ -985,7 +996,7 @@ function createMemorySiteStore(options = {}) {
985
996
  const at = now().toISOString();
986
997
  p.published = { doc: clone(p.doc), at };
987
998
  p.status = "published";
988
- p.publishedAt ??= at;
999
+ p.publishedAt ??= p.importedPublishedAt ?? at;
989
1000
  p.updatedAt = at;
990
1001
  return postMeta(p);
991
1002
  },
@@ -1024,7 +1035,7 @@ function createMemorySiteStore(options = {}) {
1024
1035
  const postId = id("post");
1025
1036
  const at = now().toISOString();
1026
1037
  const published = prepared.status === "published" ? { doc: clone(prepared.doc), at: prepared.publishedAt } : null;
1027
- posts.set(postId, { id: postId, siteId, slug: item.slug, doc: prepared.doc, rev: 1, status: prepared.status, published, publishedAt: published ? prepared.publishedAt : null, updatedAt: at, deleted: false });
1038
+ posts.set(postId, { id: postId, siteId, slug: item.slug, doc: prepared.doc, rev: 1, status: prepared.status, published, publishedAt: published ? prepared.publishedAt : null, importedPublishedAt: published || !item.publishedAt ? null : prepared.publishedAt, updatedAt: at, deleted: false });
1028
1039
  result.imported.push({ slug: item.slug, id: postId, status: prepared.status, ...prepared.issues.length ? { issues: prepared.issues } : {} });
1029
1040
  }
1030
1041
  return result;
@@ -1034,5 +1045,5 @@ function createMemorySiteStore(options = {}) {
1034
1045
  }
1035
1046
 
1036
1047
  export { ASSET_TYPES, PublishBlockedError, SiteConflictError, assetPath, brandDisplayName, checkAssetHosts, checkBlog, checkContrast, checkHtmlOutline, checkPage, checkPost, checkRelease, checkSiteDoc, contrastRatio, createMemorySiteStore, formCacheTag, hexToHslTriplet, isConflict, isOwnUrl, isPublishable, isSiteBrand, luminance, migrateNode, migratePage, migrateSite, mix, parseHex, prepareImportPost, prepareRelease, siteCacheTag, siteTheme, stableHash, themeCss, toCanonicalBrand, withCacheInvalidation };
1037
- //# sourceMappingURL=chunk-VJ4HOFBA.js.map
1038
- //# sourceMappingURL=chunk-VJ4HOFBA.js.map
1048
+ //# sourceMappingURL=chunk-YAMQ2JKO.js.map
1049
+ //# sourceMappingURL=chunk-YAMQ2JKO.js.map