@yatoday/astro-ui 0.16.10 → 0.16.12
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.
|
@@ -8,10 +8,13 @@ import type { LayoutProps as Props } from './types';
|
|
|
8
8
|
import { I18N } from 'vendor:config';
|
|
9
9
|
|
|
10
10
|
const { metadata = {}, class: className } = Astro.props;
|
|
11
|
-
const { language, textDirection } = I18N;
|
|
11
|
+
const { language, textDirection, locales, defaultLocale } = I18N;
|
|
12
12
|
|
|
13
13
|
// Use current locale from Astro's i18n routing, fallback to config
|
|
14
14
|
const currentLang = Astro.currentLocale || language;
|
|
15
|
+
|
|
16
|
+
// Build i18n config for Metadata component (for hreflang generation)
|
|
17
|
+
const i18nConfig = locales?.length ? { locales, defaultLocale: defaultLocale || language } : undefined;
|
|
15
18
|
---
|
|
16
19
|
|
|
17
20
|
<!doctype html>
|
|
@@ -20,7 +23,7 @@ const currentLang = Astro.currentLocale || language;
|
|
|
20
23
|
<meta charset="UTF-8" />
|
|
21
24
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
22
25
|
|
|
23
|
-
<SeoMetadata {...metadata} />
|
|
26
|
+
<SeoMetadata {...metadata} i18n={i18nConfig} />
|
|
24
27
|
|
|
25
28
|
<slot name="head" />
|
|
26
29
|
<slot name="styles" />
|
|
@@ -94,8 +94,8 @@ const ogImage = processedOpenGraph?.images?.[0]
|
|
|
94
94
|
: undefined;
|
|
95
95
|
|
|
96
96
|
const finalOpenGraph = {
|
|
97
|
-
title: finalTitle,
|
|
98
|
-
description: finalDescription,
|
|
97
|
+
title: processedOpenGraph?.title || finalTitle,
|
|
98
|
+
description: processedOpenGraph?.description || finalDescription,
|
|
99
99
|
url: canonical,
|
|
100
100
|
type: (processedOpenGraph?.type as string) || 'website',
|
|
101
101
|
image: ogImage,
|
package/package.json
CHANGED