nuxt-seo-utils 5.0.1 → 5.0.2

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/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.6.1",
6
6
  "bridge": false
7
7
  },
8
- "version": "5.0.0",
8
+ "version": "5.0.1",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -476,6 +476,7 @@ const module = defineNuxtModule({
476
476
  middleware: true
477
477
  });
478
478
  }
479
+ nuxt.options.alias["#seo-utils"] = resolve("./runtime");
479
480
  nuxt.options.runtimeConfig.public["nuxt-seo"] = {
480
481
  canonicalQueryWhitelist: config.canonicalQueryWhitelist || [
481
482
  "page",
@@ -52,23 +52,16 @@ export function useBreadcrumbItems(options = {}) {
52
52
  return segments.filter(Boolean).map((item) => {
53
53
  const route = router.resolve(item.to)?.matched?.[0] || router.currentRoute.value;
54
54
  const routeMeta = route?.meta || {};
55
- const routeName = route ? String(route.name || route.path) : item.to === "/" ? "index" : "unknown";
56
- let [name] = routeName.split("___");
57
- if (name === "unknown" || name.includes("/") || route.path?.includes(":"))
58
- name = (item.to || "").split("/").pop() || "";
55
+ const routeName = route ? String(route.name.split("___")) : item.to === "/" ? "index" : null;
56
+ const fallbackLabel = titleCase(routeName === "index" ? "Home" : (item.to || "").split("/").pop() || "");
59
57
  if (routeMeta.breadcrumb) {
60
58
  item = {
61
59
  ...item,
62
60
  ...routeMeta.breadcrumb
63
61
  };
64
62
  }
65
- item.label = item.label || routeMeta.breadcrumbTitle || routeMeta.title;
66
- if (typeof item.label === "undefined") {
67
- item.label = i18n.t(`breadcrumb.items.${name}.label`, name === "index" ? "Home" : titleCase(name), { missingWarn: false });
68
- }
69
- if (typeof item.ariaLabel === "undefined") {
70
- item.ariaLabel = i18n.t(`breadcrumb.items.${name}.ariaLabel`, item.label, { missingWarn: false }) || item.label;
71
- }
63
+ item.label = item.label || routeMeta.title || routeMeta.breadcrumbTitle || i18n.t(`breadcrumb.items.${routeName}.label`, fallbackLabel, { missingWarn: false });
64
+ item.ariaLabel = item.ariaLabel || i18n.t(`breadcrumb.items.${routeName}.ariaLabel`, item.label, { missingWarn: false }) || item.label;
72
65
  item.current = item.current || item.to === current;
73
66
  if (toValue(options.hideCurrent) && item.current)
74
67
  return false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-seo-utils",
3
3
  "type": "module",
4
- "version": "5.0.1",
4
+ "version": "5.0.2",
5
5
  "description": "SEO utilities to improve your Nuxt sites discoverability and shareability",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -53,7 +53,7 @@
53
53
  "@nuxtjs/i18n": "^8.5.5",
54
54
  "@unhead/shared": "^1.11.10",
55
55
  "@vue/test-utils": "^2.4.6",
56
- "bumpp": "^9.7.1",
56
+ "bumpp": "^9.8.0",
57
57
  "case-police": "^0.7.0",
58
58
  "cheerio": "1.0.0",
59
59
  "eslint": "^9.13.0",
@@ -61,10 +61,10 @@
61
61
  "markdownlint-cli": "^0.42.0",
62
62
  "nuxt": "^3.13.2",
63
63
  "nuxt-content-twoslash": "^0.1.1",
64
- "playwright-core": "^1.48.1",
65
- "sass": "^1.80.3",
64
+ "playwright-core": "^1.48.2",
65
+ "sass": "^1.80.5",
66
66
  "typescript": "5.6.3",
67
- "vitest": "^2.1.3"
67
+ "vitest": "^2.1.4"
68
68
  },
69
69
  "scripts": {
70
70
  "lint": "eslint . --fix",