@press2ai/engine 0.4.1 → 0.4.3
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/package.json +1 -1
- package/src/ceidg-vertical.ts +6 -0
- package/src/template-trener.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@press2ai/engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Multi-tenant runtime + template contracts dla otwarty-* verticali. SSR na Cloudflare Workers, isomorphic renderer (SSG/browser w roadmapie).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/ceidg-vertical.ts
CHANGED
|
@@ -77,6 +77,10 @@ export interface VerticalConfig {
|
|
|
77
77
|
heroTitle: string;
|
|
78
78
|
heroSubtitle?: string;
|
|
79
79
|
searchPlaceholder?: string;
|
|
80
|
+
/** Plural label for count in statBar (e.g. 'trenerów', 'terapeutów'). Default 'wpisów'. */
|
|
81
|
+
itemsLabel?: string;
|
|
82
|
+
/** Singular fallback for 404 (e.g. 'trenera', 'terapeuty'). Default 'wpisu'. */
|
|
83
|
+
itemSingular?: string;
|
|
80
84
|
};
|
|
81
85
|
/** PKD → human-readable jobTitle. Per-wertykal mapping. */
|
|
82
86
|
pkdToJobTitle(pkd: string | null | undefined): string;
|
|
@@ -159,6 +163,8 @@ export function createVerticalApp(config: VerticalConfig): Hono<{ Bindings: Ceid
|
|
|
159
163
|
heroTitle: copy.heroTitle,
|
|
160
164
|
heroSubtitle: copy.heroSubtitle,
|
|
161
165
|
searchPlaceholder: copy.searchPlaceholder ?? 'Szukaj...',
|
|
166
|
+
itemsLabel: copy.itemsLabel ?? 'wpisów',
|
|
167
|
+
itemSingular: copy.itemSingular ?? 'wpisu',
|
|
162
168
|
},
|
|
163
169
|
profiles: (leadsRes.results ?? []).map(leadToProfile),
|
|
164
170
|
cities: citiesRes.results ?? [],
|
package/src/template-trener.ts
CHANGED
|
@@ -67,6 +67,10 @@ const trenerContentSchema = z.object({
|
|
|
67
67
|
heroTitle: z.string(),
|
|
68
68
|
heroSubtitle: z.string().optional(),
|
|
69
69
|
searchPlaceholder: z.string().default('Szukaj...'),
|
|
70
|
+
/** Plural label for the count in statBar (e.g. 'trenerów', 'terapeutów'). */
|
|
71
|
+
itemsLabel: z.string(),
|
|
72
|
+
/** Singular fallback shown on 404 (e.g. 'trenera', 'terapeuty'). */
|
|
73
|
+
itemSingular: z.string(),
|
|
70
74
|
}),
|
|
71
75
|
profiles: z.array(profileSchema),
|
|
72
76
|
cities: z.array(z.object({ name: z.string(), count: z.number() })).default([]),
|
|
@@ -96,6 +100,8 @@ export const trenerTemplate: PresenceTemplate<TrenerContent, TrenerTheme> = {
|
|
|
96
100
|
heroTitle: 'Znajdź trenera w Twojej okolicy',
|
|
97
101
|
heroSubtitle: 'Otwarty katalog trenerów. Bezpłatnie i bez rejestracji.',
|
|
98
102
|
searchPlaceholder: 'Szukaj po nazwisku, mieście lub firmie...',
|
|
103
|
+
itemsLabel: 'wpisów',
|
|
104
|
+
itemSingular: 'wpisu',
|
|
99
105
|
},
|
|
100
106
|
profiles: [],
|
|
101
107
|
cities: [],
|
|
@@ -196,7 +202,7 @@ function renderIndex(req: RenderRequest<TrenerContent>, ctx: RenderContext<Trene
|
|
|
196
202
|
});
|
|
197
203
|
|
|
198
204
|
const stats = t.statBar([
|
|
199
|
-
{ value: total.toLocaleString('pl'), label:
|
|
205
|
+
{ value: total.toLocaleString('pl'), label: content.copy.itemsLabel, icon: 'people' },
|
|
200
206
|
{ value: String(content.cities.length), label: 'miast', icon: 'city' },
|
|
201
207
|
{ value: '100%', label: 'bezpłatnie', icon: 'free' },
|
|
202
208
|
]);
|
|
@@ -241,7 +247,7 @@ function renderProfile(req: RenderRequest<TrenerContent>, ctx: RenderContext<Tre
|
|
|
241
247
|
if (!profile) {
|
|
242
248
|
return {
|
|
243
249
|
status: 404,
|
|
244
|
-
body: ctx.theme.layout({ title: 'Nie znaleziono' },
|
|
250
|
+
body: ctx.theme.layout({ title: 'Nie znaleziono' }, `<h1>404</h1><p>Brak takiego ${req.content.copy.itemSingular}.</p>`),
|
|
245
251
|
};
|
|
246
252
|
}
|
|
247
253
|
|