@yatoday/astro-ui 0.17.9 → 0.17.11

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.
@@ -39,18 +39,19 @@ const locale = urlParts[0] && supportedLocales.includes(urlParts[0]) ? urlParts[
39
39
  // Build alternate locale links for hreflang (including self-reference)
40
40
  // Use alternateUrls if provided (for blog posts with different slugs per language)
41
41
  // Otherwise, use path-based replacement for static pages
42
+ // When alternateUrls is provided, ONLY include languages that have a URL (no fallback)
42
43
  const alternateLocales = alternateUrls
43
44
  ? supportedLocales
45
+ .filter((lang) => alternateUrls[lang]) // Only include languages with actual URLs
44
46
  .map((lang) => ({
45
47
  locale: lang,
46
- url: alternateUrls[lang] || String(new URL(pathname.replace(`/${locale}/`, `/${lang}/`), Astro.site)),
48
+ url: alternateUrls[lang],
47
49
  }))
48
- .concat([
49
- {
50
- locale: 'x-default',
51
- url: alternateUrls[defaultLocale] || String(new URL(pathname.replace(`/${locale}/`, `/${defaultLocale}/`), Astro.site)),
52
- },
53
- ])
50
+ .concat(
51
+ alternateUrls[defaultLocale]
52
+ ? [{ locale: 'x-default', url: alternateUrls[defaultLocale] }]
53
+ : []
54
+ )
54
55
  : supportedLocales
55
56
  .map((lang) => {
56
57
  // Replace current locale with target locale and ensure trailing slash
@@ -107,6 +107,8 @@ const imagePaths = Object.keys(images).filter((imagePath) => {
107
107
  </div>
108
108
  )
109
109
  }
110
+
111
+ <slot />
110
112
  </WidgetWrapper>
111
113
 
112
114
  <script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yatoday/astro-ui",
3
3
  "type": "module",
4
- "version": "0.17.9",
4
+ "version": "0.17.11",
5
5
  "scripts": {
6
6
  "prepare": "husky",
7
7
  "pre-commit": "lint-staged",