@shipsite.dev/core 0.2.13 → 0.2.15
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/dist/blog.d.ts +1 -1
- package/dist/blog.d.ts.map +1 -1
- package/dist/blog.js +3 -7
- package/dist/blog.js.map +1 -1
- package/dist/config.d.ts +35 -35
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -4
- package/dist/config.js.map +1 -1
- package/dist/content-collections.d.ts +15 -2
- package/dist/content-collections.d.ts.map +1 -1
- package/dist/content-collections.js +6 -12
- package/dist/content-collections.js.map +1 -1
- package/dist/i18n.d.ts +7 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +13 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mdx.d.ts +1 -0
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +13 -1
- package/dist/mdx.js.map +1 -1
- package/package.json +1 -1
package/dist/blog.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { getLocalizedField } from './i18n';
|
|
1
2
|
export interface ResolvedArticle {
|
|
2
3
|
slug: string;
|
|
3
4
|
contentKey: string;
|
|
@@ -22,7 +23,6 @@ export interface ResolvedCategory {
|
|
|
22
23
|
key: string;
|
|
23
24
|
label: string;
|
|
24
25
|
}
|
|
25
|
-
export declare function getLocalizedField(field: string | Record<string, string> | undefined, locale: string): string;
|
|
26
26
|
export declare function resolveAuthor(key: string, locale: string): ResolvedAuthor | undefined;
|
|
27
27
|
export declare function getBlogArticles(locale: string): ResolvedArticle[];
|
|
28
28
|
export declare function getCategories(locale: string): ResolvedCategory[];
|
package/dist/blog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blog.d.ts","sourceRoot":"","sources":["../src/blog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blog.d.ts","sourceRoot":"","sources":["../src/blog.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,SAAS,CAc5B;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE,CAwCjE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAOhE"}
|
package/dist/blog.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { allSitePages } from 'content-collections';
|
|
2
2
|
import { getConfig } from './config';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (typeof field === 'string')
|
|
7
|
-
return field;
|
|
8
|
-
return field[locale] || field.en || '';
|
|
9
|
-
}
|
|
3
|
+
import { getLocalizedField } from './i18n';
|
|
4
|
+
// Re-export for backward compatibility
|
|
5
|
+
export { getLocalizedField } from './i18n';
|
|
10
6
|
export function resolveAuthor(key, locale) {
|
|
11
7
|
const config = getConfig();
|
|
12
8
|
const authors = config.blog?.authors;
|
package/dist/blog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blog.js","sourceRoot":"","sources":["../src/blog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"blog.js","sourceRoot":"","sources":["../src/blog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,uCAAuC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AA6B3C,MAAM,UAAU,aAAa,CAC3B,GAAW,EACX,MAAc;IAEd,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC;IACrC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAE9B,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;QAC5C,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;QACzB,GAAG,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC;KAC3C,CAAC;AACJ,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.ZodObject<{
|
|
75
|
-
label: z.ZodString
|
|
75
|
+
label: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
76
76
|
href: z.ZodString;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
|
-
label: string
|
|
78
|
+
label: string | Record<string, string>;
|
|
79
79
|
href: string;
|
|
80
80
|
}, {
|
|
81
|
-
label: string
|
|
81
|
+
label: string | Record<string, string>;
|
|
82
82
|
href: string;
|
|
83
83
|
}>, "many">;
|
|
84
84
|
cta: z.ZodOptional<z.ZodObject<{
|
|
85
|
-
label: z.ZodString
|
|
85
|
+
label: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
86
86
|
href: z.ZodString;
|
|
87
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
label: string
|
|
88
|
+
label: string | Record<string, string>;
|
|
89
89
|
href: string;
|
|
90
90
|
}, {
|
|
91
|
-
label: string
|
|
91
|
+
label: string | Record<string, string>;
|
|
92
92
|
href: string;
|
|
93
93
|
}>>;
|
|
94
94
|
}, "strip", z.ZodTypeAny, {
|
|
95
95
|
items: {
|
|
96
|
-
label: string
|
|
96
|
+
label: string | Record<string, string>;
|
|
97
97
|
href: string;
|
|
98
98
|
}[];
|
|
99
99
|
cta?: {
|
|
100
|
-
label: string
|
|
100
|
+
label: string | Record<string, string>;
|
|
101
101
|
href: string;
|
|
102
102
|
} | undefined;
|
|
103
103
|
}, {
|
|
104
104
|
items: {
|
|
105
|
-
label: string
|
|
105
|
+
label: string | Record<string, string>;
|
|
106
106
|
href: string;
|
|
107
107
|
}[];
|
|
108
108
|
cta?: {
|
|
109
|
-
label: string
|
|
109
|
+
label: string | Record<string, string>;
|
|
110
110
|
href: string;
|
|
111
111
|
} | undefined;
|
|
112
112
|
}>>;
|
|
113
113
|
footer: z.ZodOptional<z.ZodObject<{
|
|
114
114
|
columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
-
title: z.ZodString
|
|
115
|
+
title: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
116
116
|
links: z.ZodArray<z.ZodObject<{
|
|
117
|
-
label: z.ZodString
|
|
117
|
+
label: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
118
118
|
href: z.ZodString;
|
|
119
119
|
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
label: string
|
|
120
|
+
label: string | Record<string, string>;
|
|
121
121
|
href: string;
|
|
122
122
|
}, {
|
|
123
|
-
label: string
|
|
123
|
+
label: string | Record<string, string>;
|
|
124
124
|
href: string;
|
|
125
125
|
}>, "many">;
|
|
126
126
|
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
title: string
|
|
127
|
+
title: string | Record<string, string>;
|
|
128
128
|
links: {
|
|
129
|
-
label: string
|
|
129
|
+
label: string | Record<string, string>;
|
|
130
130
|
href: string;
|
|
131
131
|
}[];
|
|
132
132
|
}, {
|
|
133
|
-
title: string
|
|
133
|
+
title: string | Record<string, string>;
|
|
134
134
|
links: {
|
|
135
|
-
label: string
|
|
135
|
+
label: string | Record<string, string>;
|
|
136
136
|
href: string;
|
|
137
137
|
}[];
|
|
138
138
|
}>, "many">>;
|
|
@@ -146,12 +146,12 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
146
146
|
href: string;
|
|
147
147
|
platform: string;
|
|
148
148
|
}>, "many">>;
|
|
149
|
-
copyright: z.ZodOptional<z.ZodString
|
|
149
|
+
copyright: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
150
150
|
}, "strip", z.ZodTypeAny, {
|
|
151
151
|
columns?: {
|
|
152
|
-
title: string
|
|
152
|
+
title: string | Record<string, string>;
|
|
153
153
|
links: {
|
|
154
|
-
label: string
|
|
154
|
+
label: string | Record<string, string>;
|
|
155
155
|
href: string;
|
|
156
156
|
}[];
|
|
157
157
|
}[] | undefined;
|
|
@@ -159,12 +159,12 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
159
159
|
href: string;
|
|
160
160
|
platform: string;
|
|
161
161
|
}[] | undefined;
|
|
162
|
-
copyright?: string | undefined;
|
|
162
|
+
copyright?: string | Record<string, string> | undefined;
|
|
163
163
|
}, {
|
|
164
164
|
columns?: {
|
|
165
|
-
title: string
|
|
165
|
+
title: string | Record<string, string>;
|
|
166
166
|
links: {
|
|
167
|
-
label: string
|
|
167
|
+
label: string | Record<string, string>;
|
|
168
168
|
href: string;
|
|
169
169
|
}[];
|
|
170
170
|
}[] | undefined;
|
|
@@ -172,7 +172,7 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
172
172
|
href: string;
|
|
173
173
|
platform: string;
|
|
174
174
|
}[] | undefined;
|
|
175
|
-
copyright?: string | undefined;
|
|
175
|
+
copyright?: string | Record<string, string> | undefined;
|
|
176
176
|
}>>;
|
|
177
177
|
pages: z.ZodArray<z.ZodObject<{
|
|
178
178
|
slug: z.ZodString;
|
|
@@ -283,19 +283,19 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
283
283
|
} | undefined;
|
|
284
284
|
navigation?: {
|
|
285
285
|
items: {
|
|
286
|
-
label: string
|
|
286
|
+
label: string | Record<string, string>;
|
|
287
287
|
href: string;
|
|
288
288
|
}[];
|
|
289
289
|
cta?: {
|
|
290
|
-
label: string
|
|
290
|
+
label: string | Record<string, string>;
|
|
291
291
|
href: string;
|
|
292
292
|
} | undefined;
|
|
293
293
|
} | undefined;
|
|
294
294
|
footer?: {
|
|
295
295
|
columns?: {
|
|
296
|
-
title: string
|
|
296
|
+
title: string | Record<string, string>;
|
|
297
297
|
links: {
|
|
298
|
-
label: string
|
|
298
|
+
label: string | Record<string, string>;
|
|
299
299
|
href: string;
|
|
300
300
|
}[];
|
|
301
301
|
}[] | undefined;
|
|
@@ -303,7 +303,7 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
303
303
|
href: string;
|
|
304
304
|
platform: string;
|
|
305
305
|
}[] | undefined;
|
|
306
|
-
copyright?: string | undefined;
|
|
306
|
+
copyright?: string | Record<string, string> | undefined;
|
|
307
307
|
} | undefined;
|
|
308
308
|
blog?: {
|
|
309
309
|
authors?: Record<string, {
|
|
@@ -354,19 +354,19 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
354
354
|
} | undefined;
|
|
355
355
|
navigation?: {
|
|
356
356
|
items: {
|
|
357
|
-
label: string
|
|
357
|
+
label: string | Record<string, string>;
|
|
358
358
|
href: string;
|
|
359
359
|
}[];
|
|
360
360
|
cta?: {
|
|
361
|
-
label: string
|
|
361
|
+
label: string | Record<string, string>;
|
|
362
362
|
href: string;
|
|
363
363
|
} | undefined;
|
|
364
364
|
} | undefined;
|
|
365
365
|
footer?: {
|
|
366
366
|
columns?: {
|
|
367
|
-
title: string
|
|
367
|
+
title: string | Record<string, string>;
|
|
368
368
|
links: {
|
|
369
|
-
label: string
|
|
369
|
+
label: string | Record<string, string>;
|
|
370
370
|
href: string;
|
|
371
371
|
}[];
|
|
372
372
|
}[] | undefined;
|
|
@@ -374,7 +374,7 @@ declare const ShipSiteConfigSchema: z.ZodObject<{
|
|
|
374
374
|
href: string;
|
|
375
375
|
platform: string;
|
|
376
376
|
}[] | undefined;
|
|
377
|
-
copyright?: string | undefined;
|
|
377
|
+
copyright?: string | Record<string, string> | undefined;
|
|
378
378
|
} | undefined;
|
|
379
379
|
blog?: {
|
|
380
380
|
authors?: Record<string, {
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;EAKpB,CAAC;AAwBH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK1D,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,CAS3D;AAED,wBAAgB,SAAS,IAAI,cAAc,CAK1C;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAErC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
package/dist/config.js
CHANGED
|
@@ -2,8 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
// ─── Schema ────────────────────────────────────────────────────
|
|
5
|
+
const LocalizedString = z.union([z.string(), z.record(z.string())]);
|
|
5
6
|
const NavigationItemSchema = z.object({
|
|
6
|
-
label:
|
|
7
|
+
label: LocalizedString,
|
|
7
8
|
href: z.string(),
|
|
8
9
|
});
|
|
9
10
|
const NavigationSchema = z.object({
|
|
@@ -11,8 +12,8 @@ const NavigationSchema = z.object({
|
|
|
11
12
|
cta: NavigationItemSchema.optional(),
|
|
12
13
|
});
|
|
13
14
|
const FooterColumnSchema = z.object({
|
|
14
|
-
title:
|
|
15
|
-
links: z.array(z.object({ label:
|
|
15
|
+
title: LocalizedString,
|
|
16
|
+
links: z.array(z.object({ label: LocalizedString, href: z.string() })),
|
|
16
17
|
});
|
|
17
18
|
const SocialLinkSchema = z.object({
|
|
18
19
|
platform: z.string(),
|
|
@@ -21,7 +22,7 @@ const SocialLinkSchema = z.object({
|
|
|
21
22
|
const FooterSchema = z.object({
|
|
22
23
|
columns: z.array(FooterColumnSchema).optional(),
|
|
23
24
|
social: z.array(SocialLinkSchema).optional(),
|
|
24
|
-
copyright:
|
|
25
|
+
copyright: LocalizedString.optional(),
|
|
25
26
|
});
|
|
26
27
|
const PageConfigSchema = z.object({
|
|
27
28
|
slug: z.string(),
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,kEAAkE;AAClE,MAAM,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,kEAAkE;AAClE,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,C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,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,EAAE,CAAC,IAAI,EAAE,aAAa,IAAI,IAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,SAAS,EAAE,CAAC,IAAI,EAAE,YAAY,IAAI,WAAW,CAAC;AACvD,CAAC"}
|
|
@@ -4,9 +4,10 @@ import { z } from 'zod';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function resolveKind(directory: string): string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Return the excerpt for blog listings.
|
|
8
|
+
* Uses explicit excerpt if provided, otherwise falls back to description.
|
|
8
9
|
*/
|
|
9
|
-
export declare function extractExcerpt(
|
|
10
|
+
export declare function extractExcerpt(excerpt: string | undefined, description: string | undefined): string;
|
|
10
11
|
export declare const sitePages: import("@content-collections/core").Collection<"sitePages", z.ZodObject<{
|
|
11
12
|
content: z.ZodString;
|
|
12
13
|
title: z.ZodString;
|
|
@@ -18,6 +19,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
18
19
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
19
20
|
author: z.ZodOptional<z.ZodString>;
|
|
20
21
|
slug: z.ZodOptional<z.ZodString>;
|
|
22
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
21
23
|
}, "strip", z.ZodTypeAny, {
|
|
22
24
|
title: string;
|
|
23
25
|
content: string;
|
|
@@ -29,6 +31,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
29
31
|
readingTime?: number | undefined;
|
|
30
32
|
featured?: boolean | undefined;
|
|
31
33
|
author?: string | undefined;
|
|
34
|
+
excerpt?: string | undefined;
|
|
32
35
|
}, {
|
|
33
36
|
title: string;
|
|
34
37
|
content: string;
|
|
@@ -40,6 +43,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
40
43
|
readingTime?: number | undefined;
|
|
41
44
|
featured?: boolean | undefined;
|
|
42
45
|
author?: string | undefined;
|
|
46
|
+
excerpt?: string | undefined;
|
|
43
47
|
}>, "frontmatter", import("@content-collections/core").Schema<"frontmatter", z.ZodObject<{
|
|
44
48
|
content: z.ZodString;
|
|
45
49
|
title: z.ZodString;
|
|
@@ -51,6 +55,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
51
55
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
52
56
|
author: z.ZodOptional<z.ZodString>;
|
|
53
57
|
slug: z.ZodOptional<z.ZodString>;
|
|
58
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
54
59
|
}, "strip", z.ZodTypeAny, {
|
|
55
60
|
title: string;
|
|
56
61
|
content: string;
|
|
@@ -62,6 +67,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
62
67
|
readingTime?: number | undefined;
|
|
63
68
|
featured?: boolean | undefined;
|
|
64
69
|
author?: string | undefined;
|
|
70
|
+
excerpt?: string | undefined;
|
|
65
71
|
}, {
|
|
66
72
|
title: string;
|
|
67
73
|
content: string;
|
|
@@ -73,6 +79,7 @@ export declare const sitePages: import("@content-collections/core").Collection<"
|
|
|
73
79
|
readingTime?: number | undefined;
|
|
74
80
|
featured?: boolean | undefined;
|
|
75
81
|
author?: string | undefined;
|
|
82
|
+
excerpt?: string | undefined;
|
|
76
83
|
}>>, {
|
|
77
84
|
locale: string;
|
|
78
85
|
contentFolder: string;
|
|
@@ -131,6 +138,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
131
138
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
132
139
|
author: z.ZodOptional<z.ZodString>;
|
|
133
140
|
slug: z.ZodOptional<z.ZodString>;
|
|
141
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
134
142
|
}, "strip", z.ZodTypeAny, {
|
|
135
143
|
title: string;
|
|
136
144
|
content: string;
|
|
@@ -142,6 +150,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
142
150
|
readingTime?: number | undefined;
|
|
143
151
|
featured?: boolean | undefined;
|
|
144
152
|
author?: string | undefined;
|
|
153
|
+
excerpt?: string | undefined;
|
|
145
154
|
}, {
|
|
146
155
|
title: string;
|
|
147
156
|
content: string;
|
|
@@ -153,6 +162,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
153
162
|
readingTime?: number | undefined;
|
|
154
163
|
featured?: boolean | undefined;
|
|
155
164
|
author?: string | undefined;
|
|
165
|
+
excerpt?: string | undefined;
|
|
156
166
|
}>, "frontmatter", import("@content-collections/core").Schema<"frontmatter", z.ZodObject<{
|
|
157
167
|
content: z.ZodString;
|
|
158
168
|
title: z.ZodString;
|
|
@@ -164,6 +174,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
164
174
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
165
175
|
author: z.ZodOptional<z.ZodString>;
|
|
166
176
|
slug: z.ZodOptional<z.ZodString>;
|
|
177
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
167
178
|
}, "strip", z.ZodTypeAny, {
|
|
168
179
|
title: string;
|
|
169
180
|
content: string;
|
|
@@ -175,6 +186,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
175
186
|
readingTime?: number | undefined;
|
|
176
187
|
featured?: boolean | undefined;
|
|
177
188
|
author?: string | undefined;
|
|
189
|
+
excerpt?: string | undefined;
|
|
178
190
|
}, {
|
|
179
191
|
title: string;
|
|
180
192
|
content: string;
|
|
@@ -186,6 +198,7 @@ export declare function createContentCollectionsConfig(): import("@content-colle
|
|
|
186
198
|
readingTime?: number | undefined;
|
|
187
199
|
featured?: boolean | undefined;
|
|
188
200
|
author?: string | undefined;
|
|
201
|
+
excerpt?: string | undefined;
|
|
189
202
|
}>>, {
|
|
190
203
|
locale: string;
|
|
191
204
|
contentFolder: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-collections.d.ts","sourceRoot":"","sources":["../src/content-collections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED
|
|
1
|
+
{"version":3,"file":"content-collections.d.ts","sourceRoot":"","sources":["../src/content-collections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEnG;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCpB,CAAC;AAEH,wBAAgB,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAI7C"}
|
|
@@ -10,18 +10,11 @@ export function resolveKind(directory) {
|
|
|
10
10
|
return 'page';
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Return the excerpt for blog listings.
|
|
14
|
+
* Uses explicit excerpt if provided, otherwise falls back to description.
|
|
14
15
|
*/
|
|
15
|
-
export function extractExcerpt(
|
|
16
|
-
|
|
17
|
-
if (!match)
|
|
18
|
-
return '';
|
|
19
|
-
return match[1]
|
|
20
|
-
.replace(/\*\*(.*?)\*\*/g, '$1')
|
|
21
|
-
.replace(/\[(.*?)\]\(.*?\)/g, '$1')
|
|
22
|
-
.replace(/[*_~`]/g, '')
|
|
23
|
-
.replace(/\n+/g, ' ')
|
|
24
|
-
.trim();
|
|
16
|
+
export function extractExcerpt(excerpt, description) {
|
|
17
|
+
return (excerpt || description || '').trim();
|
|
25
18
|
}
|
|
26
19
|
export const sitePages = defineCollection({
|
|
27
20
|
name: 'sitePages',
|
|
@@ -38,13 +31,14 @@ export const sitePages = defineCollection({
|
|
|
38
31
|
featured: z.boolean().optional(),
|
|
39
32
|
author: z.string().optional(),
|
|
40
33
|
slug: z.string().optional(),
|
|
34
|
+
excerpt: z.string().optional(),
|
|
41
35
|
}),
|
|
42
36
|
transform: (doc) => {
|
|
43
37
|
const locale = doc._meta.fileName.replace(/\.mdx$/, '');
|
|
44
38
|
const contentFolder = doc._meta.directory;
|
|
45
39
|
const contentId = doc._meta.path.replace(/\.mdx$/, '');
|
|
46
40
|
const kind = resolveKind(doc._meta.directory);
|
|
47
|
-
const excerpt = extractExcerpt(doc.
|
|
41
|
+
const excerpt = extractExcerpt(doc.excerpt, doc.description);
|
|
48
42
|
return {
|
|
49
43
|
...doc,
|
|
50
44
|
locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-collections.js","sourceRoot":"","sources":["../src/content-collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB;IAC3C,IAAI,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"content-collections.js","sourceRoot":"","sources":["../src/content-collections.ts"],"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B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACxD,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;QAC1C,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;QAE7D,OAAO;YACL,GAAG,GAAG;YACN,MAAM;YACN,aAAa;YACb,SAAS;YACT,IAAI;YACJ,OAAO;YACP,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,SAAS,CAAC;KACrB,CAAC,CAAC;AACL,CAAC"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a localized field value.
|
|
3
|
+
* Accepts a plain string (returned as-is) or a locale map like `{ en: "Features", de: "Funktionen" }`.
|
|
4
|
+
* Falls back to the `en` key when the requested locale is missing.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getLocalizedField(field: string | Record<string, string> | undefined, locale: string): string;
|
|
7
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClD,MAAM,EAAE,MAAM,GACb,MAAM,CAIR"}
|
package/dist/i18n.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a localized field value.
|
|
3
|
+
* Accepts a plain string (returned as-is) or a locale map like `{ en: "Features", de: "Funktionen" }`.
|
|
4
|
+
* Falls back to the `en` key when the requested locale is missing.
|
|
5
|
+
*/
|
|
6
|
+
export function getLocalizedField(field, locale) {
|
|
7
|
+
if (!field)
|
|
8
|
+
return '';
|
|
9
|
+
if (typeof field === 'string')
|
|
10
|
+
return field;
|
|
11
|
+
return field[locale] || field.en || '';
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=i18n.js.map
|
package/dist/i18n.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAkD,EAClD,MAAc;IAEd,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3D,+FAA+F;AAC/F,mGAAmG"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3D,+FAA+F;AAC/F,mGAAmG"}
|
package/dist/mdx.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface PageFrontmatter {
|
|
|
10
10
|
wordCount?: number;
|
|
11
11
|
featured?: boolean;
|
|
12
12
|
author?: string;
|
|
13
|
+
excerpt?: string;
|
|
13
14
|
}
|
|
14
15
|
export declare function getPageContent(pageName: string, locale: string, components?: Record<string, unknown>): Promise<{
|
|
15
16
|
content: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;GAyEzC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAI5C;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAI9D"}
|
package/dist/mdx.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { compileMDX } from 'next-mdx-remote/rsc';
|
|
2
2
|
import remarkGfm from 'remark-gfm';
|
|
3
3
|
import { allSitePages } from 'content-collections';
|
|
4
|
+
import { resolveAuthor } from './blog';
|
|
4
5
|
export async function getPageContent(pageName, locale, components = {}) {
|
|
5
6
|
const page = allSitePages.find((doc) => doc.contentFolder === pageName && doc.locale === locale);
|
|
6
7
|
if (!page) {
|
|
@@ -17,7 +18,18 @@ export async function getPageContent(pageName, locale, components = {}) {
|
|
|
17
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
19
|
const Orig = components[componentName];
|
|
19
20
|
if (Orig) {
|
|
20
|
-
|
|
21
|
+
const authorData = page?.author
|
|
22
|
+
? resolveAuthor(page.author, locale)
|
|
23
|
+
: undefined;
|
|
24
|
+
allComponents[componentName] = async (props) => Orig({
|
|
25
|
+
...props,
|
|
26
|
+
contentFolder: pageName,
|
|
27
|
+
date: page?.date || '',
|
|
28
|
+
readingTime: page?.readingTime || 0,
|
|
29
|
+
author: authorData
|
|
30
|
+
? { name: authorData.name, role: authorData.role, image: authorData.image }
|
|
31
|
+
: undefined,
|
|
32
|
+
});
|
|
21
33
|
}
|
|
22
34
|
}
|
|
23
35
|
}
|
package/dist/mdx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.js","sourceRoot":"","sources":["../src/mdx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.js","sourceRoot":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