ferst-core 0.7.7 → 0.7.9
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/bin/ferst-modules.mjs +18 -2
- package/components/BlockRenderer.astro +125 -119
- package/components/Button.astro +1 -1
- package/components/CalendarEmbed.astro +2 -1
- package/components/Card.astro +2 -0
- package/components/SiteHeader.astro +24 -0
- package/components/recipes/Accordion.astro +91 -87
- package/components/recipes/Bento.astro +7 -3
- package/components/recipes/ContactForm.astro +6 -3
- package/components/recipes/Cta.astro +5 -1
- package/components/recipes/Faq.astro +5 -1
- package/components/recipes/FeatureCards.astro +115 -112
- package/components/recipes/Hero.astro +521 -495
- package/components/recipes/LatestPosts.astro +1 -1
- package/components/recipes/MediaCards.astro +214 -213
- package/components/recipes/Notice.astro +90 -90
- package/components/recipes/Pricing.astro +7 -4
- package/components/recipes/Stats.astro +155 -152
- package/components/recipes/Steps.astro +124 -121
- package/components/recipes/Tabs.astro +138 -134
- package/components/recipes/Tiles.astro +291 -287
- package/content/blocks.ts +88 -52
- package/layouts/Base.astro +496 -484
- package/lib/inline-markdown.ts +13 -0
- package/lib/slug.ts +1 -1
- package/package.json +1 -1
- package/routes/calendar/index.astro +2 -1
package/lib/inline-markdown.ts
CHANGED
|
@@ -69,3 +69,16 @@ export function inlineMarkdown(text: string | undefined | null): string {
|
|
|
69
69
|
out += inlineFormat(escapeHtml(text.slice(last)));
|
|
70
70
|
return out;
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
/** The words of formatted copy with the formatting gone (a link becomes its label): for
|
|
74
|
+
* places that must be plain text, like a page's meta description. */
|
|
75
|
+
export function plainText(text: string | undefined | null): string {
|
|
76
|
+
if (!text) return '';
|
|
77
|
+
return text
|
|
78
|
+
.replace(LINK_RE, '$1')
|
|
79
|
+
.replace(/\*\*([^*]+)\*\*/g, '$1')
|
|
80
|
+
.replace(/(^|[^*\w])\*(?![\s*])([^*]*?[^\s*])\*(?!\*)/g, '$1$2')
|
|
81
|
+
.replace(/(^|[^\w])_(?![\s_])([^_]*?[^\s_])_(?!\w)/g, '$1$2')
|
|
82
|
+
.replace(/\s*\n\s*/g, ' ')
|
|
83
|
+
.trim();
|
|
84
|
+
}
|
package/lib/slug.ts
CHANGED
|
@@ -9,7 +9,7 @@ export function slugify(text: string): string {
|
|
|
9
9
|
.normalize('NFKD')
|
|
10
10
|
.replace(/[̀-ͯ]/g, '') // accents
|
|
11
11
|
.toLowerCase()
|
|
12
|
-
.replace(/['’]/g, '') // apostrophes join the word ("
|
|
12
|
+
.replace(/['’]/g, '') // apostrophes join the word ("anne's" → "annes")
|
|
13
13
|
.replace(/[^a-z0-9]+/g, '-')
|
|
14
14
|
.replace(/^-+|-+$/g, '')
|
|
15
15
|
.slice(0, 60)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ferst-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ferst Core \u2014 the shared, brand-agnostic client-site system: Astro components, layouts, content schemas, the layered config resolver, and a neutral styling architecture that every client overrides.",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { plainText } from '../../lib/inline-markdown';
|
|
2
3
|
/**
|
|
3
4
|
* The calendar page (`/calendar`) — INJECTED by the ferst() integration. Consent-
|
|
4
5
|
* gated by CalendarEmbed (nothing loads from Google until the visitor opts in).
|
|
@@ -12,7 +13,7 @@ import { getCalendarSettings } from '../../lib/calendar';
|
|
|
12
13
|
const cal = await getCalendarSettings();
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
<Base title={cal.title} description={cal.intro || undefined}>
|
|
16
|
+
<Base title={cal.title} description={plainText(cal.intro) || undefined}>
|
|
16
17
|
<CalendarEmbed
|
|
17
18
|
title={cal.title}
|
|
18
19
|
intro={cal.intro}
|