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.
- package/NOTICE +63 -31
- package/README.md +13 -4
- package/bin/ferst-media.mjs +96 -0
- package/bin/ferst-modules.mjs +17 -2
- package/components/BlockRenderer.astro +131 -129
- package/components/Card.astro +53 -51
- package/components/MembersAccount.astro +370 -0
- package/components/PostCard.astro +138 -136
- package/components/SiteHeader.astro +32 -14
- package/components/blocks/Grid.astro +49 -48
- package/components/blocks/Heading.astro +4 -1
- package/components/islands/BookMonth.tsx +95 -0
- package/components/islands/MembersAccount.tsx +392 -0
- package/components/recipes/Banner.astro +146 -146
- package/components/recipes/Book.astro +1147 -926
- package/components/recipes/FeatureCards.astro +112 -118
- package/components/recipes/Gallery.astro +57 -59
- package/components/recipes/Hero.astro +112 -10
- package/components/recipes/LatestPosts.astro +295 -292
- package/components/recipes/Locations.astro +146 -143
- package/components/recipes/Marquee.astro +75 -75
- package/components/recipes/MediaCards.astro +213 -219
- package/components/recipes/MembersContent.astro +176 -0
- package/components/recipes/Pricing.astro +149 -150
- package/components/recipes/Stats.astro +150 -157
- package/components/recipes/Tiles.astro +342 -296
- package/content/blocks.ts +1091 -1024
- package/content/cookies.ts +14 -0
- package/content/imageSlots.mjs +542 -0
- package/content/recipe-questions.ts +81 -80
- package/content/schemas.ts +13 -11
- package/examples/recipes.ts +5 -0
- package/fonts/OFL.txt +1332 -287
- package/fonts/anton-latin-400-normal.woff2 +0 -0
- package/fonts/bangers-latin-400-normal.woff2 +0 -0
- package/fonts/bebas-neue-latin-400-normal.woff2 +0 -0
- package/fonts/bowlby-one-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-600-normal.woff2 +0 -0
- package/fonts/fredoka-latin-700-normal.woff2 +0 -0
- package/fonts/knewave-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-600-normal.woff2 +0 -0
- package/fonts/lora-latin-700-normal.woff2 +0 -0
- package/fonts/merriweather-latin-400-normal.woff2 +0 -0
- package/fonts/merriweather-latin-600-normal.woff2 +0 -0
- package/fonts/merriweather-latin-700-normal.woff2 +0 -0
- package/fonts/nunito-latin-400-normal.woff2 +0 -0
- package/fonts/nunito-latin-600-normal.woff2 +0 -0
- package/fonts/nunito-latin-700-normal.woff2 +0 -0
- package/fonts/oswald-latin-400-normal.woff2 +0 -0
- package/fonts/oswald-latin-600-normal.woff2 +0 -0
- package/fonts/oswald-latin-700-normal.woff2 +0 -0
- package/fonts/rubik-dirt-latin-400-normal.woff2 +0 -0
- package/integration.mjs +319 -263
- package/layouts/Base.astro +8 -16
- package/lib/book.ts +416 -378
- package/lib/fonts.ts +130 -0
- package/lib/gridRows.ts +197 -0
- package/lib/image-fields.ts +140 -0
- package/lib/image-size.mjs +108 -73
- package/lib/image-sizes.ts +16 -0
- package/lib/logo-header.ts +46 -0
- package/lib/media-check.mjs +524 -0
- package/lib/members-account.ts +276 -0
- package/lib/members.ts +115 -0
- package/lib/theme-preview.ts +203 -140
- package/lib/themeTokens.ts +235 -220
- package/package.json +80 -71
- package/routes/account.astro +16 -0
- package/routes/cookie-policy.astro +28 -28
- package/styles/fonts.css +239 -76
- package/styles/theme.css +228 -160
- package/lib/gridColumns.ts +0 -22
package/layouts/Base.astro
CHANGED
|
@@ -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
|
-
|
|
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 =
|
|
94
|
-
const primaryLogoDark =
|
|
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={
|
|
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}>
|