meno-core 1.0.8 → 1.0.10
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/build-static.ts +6 -4
- package/lib/shared/fontLoader.ts +3 -1
- package/package.json +1 -1
package/build-static.ts
CHANGED
|
@@ -264,7 +264,8 @@ async function buildCMSTemplates(
|
|
|
264
264
|
slugMappings: SlugMap[],
|
|
265
265
|
distDir: string,
|
|
266
266
|
cmsService: CMSService,
|
|
267
|
-
generatedUrls: Set<string
|
|
267
|
+
generatedUrls: Set<string>,
|
|
268
|
+
siteUrl?: string
|
|
268
269
|
): Promise<{ success: number; errors: number }> {
|
|
269
270
|
let successCount = 0;
|
|
270
271
|
let errorCount = 0;
|
|
@@ -309,7 +310,7 @@ async function buildCMSTemplates(
|
|
|
309
310
|
for (const item of items) {
|
|
310
311
|
for (const localeConfig of i18nConfig.locales) {
|
|
311
312
|
const locale = localeConfig.code;
|
|
312
|
-
const baseUrl = "";
|
|
313
|
+
const baseUrl = siteUrl || "";
|
|
313
314
|
const itemPath = buildCMSItemPath(cmsSchema.urlPattern, item, cmsSchema.slugField, locale, i18nConfig);
|
|
314
315
|
|
|
315
316
|
// Generate HTML with JS returned separately (CSP-compliant)
|
|
@@ -483,7 +484,7 @@ async function buildStaticPages(): Promise<void> {
|
|
|
483
484
|
// Generate HTML for each locale
|
|
484
485
|
for (const localeConfig of i18nConfig.locales) {
|
|
485
486
|
const locale = localeConfig.code;
|
|
486
|
-
const baseUrl = "";
|
|
487
|
+
const baseUrl = siteUrl || "";
|
|
487
488
|
|
|
488
489
|
// Build the URL path that will be used for this locale
|
|
489
490
|
const urlPath = getDisplayPath(basePath, locale, i18nConfig.defaultLocale, slugs);
|
|
@@ -540,7 +541,8 @@ async function buildStaticPages(): Promise<void> {
|
|
|
540
541
|
slugMappings,
|
|
541
542
|
distDir,
|
|
542
543
|
cmsService,
|
|
543
|
-
generatedUrls
|
|
544
|
+
generatedUrls,
|
|
545
|
+
siteUrl
|
|
544
546
|
);
|
|
545
547
|
successCount += cmsResult.success;
|
|
546
548
|
errorCount += cmsResult.errors;
|
package/lib/shared/fontLoader.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface FontConfig {
|
|
|
6
6
|
weight?: number;
|
|
7
7
|
weightMax?: number; // If set, font is variable with weight range [weight, weightMax]
|
|
8
8
|
style?: 'normal' | 'italic';
|
|
9
|
+
fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
interface ProjectConfig {
|
|
@@ -68,6 +69,7 @@ export function generateFontCSS(): string {
|
|
|
68
69
|
const weight = font.weight ?? 400;
|
|
69
70
|
const weightMax = font.weightMax;
|
|
70
71
|
const style = font.style ?? 'normal';
|
|
72
|
+
const fontDisplay = font.fontDisplay;
|
|
71
73
|
|
|
72
74
|
// Variable fonts use weight range syntax: "100 900"
|
|
73
75
|
const fontWeight = weightMax != null ? `${weight} ${weightMax}` : weight;
|
|
@@ -76,7 +78,7 @@ export function generateFontCSS(): string {
|
|
|
76
78
|
font-family: '${family}';
|
|
77
79
|
src: url('${font.path}') format('${format}');
|
|
78
80
|
font-weight: ${fontWeight};
|
|
79
|
-
font-style: ${style}
|
|
81
|
+
font-style: ${style};${fontDisplay ? `\n font-display: ${fontDisplay};` : ''}
|
|
80
82
|
}`;
|
|
81
83
|
})
|
|
82
84
|
.join('\n\n');
|