ferst-core 0.15.0 → 0.17.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 (74) hide show
  1. package/NOTICE +63 -31
  2. package/README.md +13 -4
  3. package/bin/ferst-media.mjs +96 -0
  4. package/bin/ferst-modules.mjs +17 -2
  5. package/components/BlockRenderer.astro +131 -129
  6. package/components/Card.astro +53 -51
  7. package/components/MembersAccount.astro +370 -0
  8. package/components/PostCard.astro +138 -136
  9. package/components/SiteHeader.astro +32 -14
  10. package/components/blocks/Grid.astro +49 -48
  11. package/components/blocks/Heading.astro +4 -1
  12. package/components/islands/BookMonth.tsx +95 -0
  13. package/components/islands/MembersAccount.tsx +392 -0
  14. package/components/recipes/Banner.astro +146 -146
  15. package/components/recipes/Book.astro +1147 -926
  16. package/components/recipes/FeatureCards.astro +112 -118
  17. package/components/recipes/Gallery.astro +57 -59
  18. package/components/recipes/Hero.astro +112 -10
  19. package/components/recipes/LatestPosts.astro +295 -292
  20. package/components/recipes/Locations.astro +146 -143
  21. package/components/recipes/Marquee.astro +75 -75
  22. package/components/recipes/MediaCards.astro +213 -219
  23. package/components/recipes/MembersContent.astro +176 -0
  24. package/components/recipes/Pricing.astro +149 -150
  25. package/components/recipes/Stats.astro +150 -157
  26. package/components/recipes/Tiles.astro +342 -296
  27. package/content/blocks.ts +1091 -1024
  28. package/content/cookies.ts +14 -0
  29. package/content/imageSlots.mjs +542 -0
  30. package/content/recipe-questions.ts +81 -80
  31. package/content/schemas.ts +13 -11
  32. package/examples/recipes.ts +5 -0
  33. package/fonts/OFL.txt +1332 -287
  34. package/fonts/anton-latin-400-normal.woff2 +0 -0
  35. package/fonts/bangers-latin-400-normal.woff2 +0 -0
  36. package/fonts/bebas-neue-latin-400-normal.woff2 +0 -0
  37. package/fonts/bowlby-one-latin-400-normal.woff2 +0 -0
  38. package/fonts/fredoka-latin-400-normal.woff2 +0 -0
  39. package/fonts/fredoka-latin-600-normal.woff2 +0 -0
  40. package/fonts/fredoka-latin-700-normal.woff2 +0 -0
  41. package/fonts/knewave-latin-400-normal.woff2 +0 -0
  42. package/fonts/lora-latin-400-normal.woff2 +0 -0
  43. package/fonts/lora-latin-600-normal.woff2 +0 -0
  44. package/fonts/lora-latin-700-normal.woff2 +0 -0
  45. package/fonts/merriweather-latin-400-normal.woff2 +0 -0
  46. package/fonts/merriweather-latin-600-normal.woff2 +0 -0
  47. package/fonts/merriweather-latin-700-normal.woff2 +0 -0
  48. package/fonts/nunito-latin-400-normal.woff2 +0 -0
  49. package/fonts/nunito-latin-600-normal.woff2 +0 -0
  50. package/fonts/nunito-latin-700-normal.woff2 +0 -0
  51. package/fonts/oswald-latin-400-normal.woff2 +0 -0
  52. package/fonts/oswald-latin-600-normal.woff2 +0 -0
  53. package/fonts/oswald-latin-700-normal.woff2 +0 -0
  54. package/fonts/rubik-dirt-latin-400-normal.woff2 +0 -0
  55. package/integration.mjs +319 -263
  56. package/layouts/Base.astro +8 -16
  57. package/lib/book.ts +416 -378
  58. package/lib/fonts.ts +130 -0
  59. package/lib/gridRows.ts +197 -0
  60. package/lib/image-fields.ts +140 -0
  61. package/lib/image-size.mjs +108 -73
  62. package/lib/image-sizes.ts +16 -0
  63. package/lib/logo-header.ts +46 -0
  64. package/lib/media-check.mjs +524 -0
  65. package/lib/members-account.ts +276 -0
  66. package/lib/members.ts +115 -0
  67. package/lib/theme-preview.ts +203 -140
  68. package/lib/themeTokens.ts +235 -220
  69. package/package.json +80 -71
  70. package/routes/account.astro +16 -0
  71. package/routes/cookie-policy.astro +28 -28
  72. package/styles/fonts.css +239 -76
  73. package/styles/theme.css +228 -160
  74. package/lib/gridColumns.ts +0 -22
@@ -28,7 +28,6 @@ import CookieBanner from '../components/CookieBanner.astro';
28
28
  import StickyCallout from '../components/StickyCallout.astro';
29
29
  import SecondaryLogo from '../components/SecondaryLogo.astro';
30
30
  import { loadSiteSettings } from '../lib/siteSettings';
31
- import { logoHeaderSchema, type HeaderLogoOverride } from '../content/schemas';
32
31
  import { getCalloutSettings } from '../lib/callout';
33
32
  import { buildThemeStyle } from '../lib/themeTokens';
34
33
  import { canonicalUrl, previewTags } from '../lib/seo.mjs';
@@ -52,8 +51,6 @@ interface Props {
52
51
  indexable?: boolean;
53
52
  /** A post: shared and described to search engines as an article with this date. */
54
53
  article?: { date: Date | string; image?: string };
55
- /** This page's header logo in place of the site's: a preview, or a test fixture. */
56
- logo?: HeaderLogoOverride;
57
54
  }
58
55
 
59
56
  const {
@@ -67,7 +64,6 @@ const {
67
64
  align = 'start',
68
65
  indexable = true,
69
66
  article,
70
- logo,
71
67
  } = Astro.props;
72
68
 
73
69
  const settings = await loadSiteSettings();
@@ -83,20 +79,16 @@ const path = Astro.url.pathname;
83
79
  // three source colours (light color-mix + dark OKLCH) and emits the font/knob
84
80
  // overrides too; selectors are doubled (`:root:root`) so they win by
85
81
  // specificity regardless of stylesheet order. `themeField` is the site-wide
86
- // input treatment, applied as a `data-field` attribute on <html>.
87
- const { css: themeCss, field: themeField } = buildThemeStyle(theme);
82
+ // input treatment, applied as a `data-field` attribute on <html>; `titleEffect`
83
+ // the finish on display titles, a `data-title-effect` attribute (styles/theme.css).
84
+ const { css: themeCss, field: themeField, titleEffect } = buildThemeStyle(theme);
88
85
 
89
86
  // Logos are optional. When a client hasn't configured one, SiteHeader renders a
90
87
  // text wordmark (the site name) rather than pointing <img> at a baked-in path
91
88
  // that may not exist — a broken logo by default was the old bug. Dark falls back
92
89
  // to the light variant when only one is supplied.
93
- const primaryLogoLight = logo ? logo.light : settings.primaryLogoLight;
94
- const primaryLogoDark = logo ? logo.dark ?? logo.light : settings.primaryLogoDark ?? settings.primaryLogoLight;
95
- // The header logo's size and placement, and its own width and height (read at build time by
96
- // the ferst() integration) so the page keeps the logo's real shape before it loads.
97
- const logoHeader = logoHeaderSchema.parse(logo ? logo.header ?? {} : settings.header);
98
- const builtLogoSize = (import.meta.env.FERST_LOGO_SIZE ?? null) as { width: number; height: number } | null;
99
- const logoSize = logo ? (logo.width && logo.height ? { width: logo.width, height: logo.height } : undefined) : builtLogoSize ?? undefined;
90
+ const primaryLogoLight = settings.primaryLogoLight;
91
+ const primaryLogoDark = settings.primaryLogoDark ?? settings.primaryLogoLight;
100
92
  const secondaryLogoLight = settings.secondaryLogoLight;
101
93
  const secondaryLogoDark = settings.secondaryLogoDark;
102
94
  const secondaryLogoLink = settings.secondaryLogoLink;
@@ -146,7 +138,7 @@ const hasFeed = Boolean(siteUrl) && import.meta.env.FERST_ROUTES_BLOG !== false;
146
138
  ---
147
139
 
148
140
  <!doctype html>
149
- <html lang="en-GB" data-field={themeField}>
141
+ <html lang="en-GB" data-field={themeField} data-title-effect={titleEffect}>
150
142
  <head>
151
143
  <meta charset="utf-8" />
152
144
  <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -272,12 +264,12 @@ const hasFeed = Boolean(siteUrl) && import.meta.env.FERST_ROUTES_BLOG !== false;
272
264
  headerClass={headerClass}
273
265
  primaryLogoLight={primaryLogoLight}
274
266
  primaryLogoDark={primaryLogoDark}
275
- logoHeader={logoHeader}
276
- logoSize={logoSize}
267
+ logoHeader={settings.header}
277
268
  brandAlt={brandAlt}
278
269
  primaryNav={navigation.primary}
279
270
  dropdown={navigation.dropdown}
280
271
  cta={navigation.cta}
272
+ account={import.meta.env.FERST_MEMBERS === true}
281
273
  />
282
274
 
283
275
  <main id="main" tabindex="-1" class:list={['site-main', mainClass]} data-content-align={align}>