nuxt-seo-utils 5.0.0 → 5.0.1
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
package/dist/module.mjs
CHANGED
|
@@ -427,8 +427,9 @@ const module = defineNuxtModule({
|
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
+
const hasI18n = hasNuxtModule("@nuxtjs/i18n") || hasNuxtModule("nuxt-i18n-micro");
|
|
430
431
|
if (config.automaticDefaults) {
|
|
431
|
-
if (
|
|
432
|
+
if (hasI18n) {
|
|
432
433
|
addPlugin({
|
|
433
434
|
src: resolve(`./runtime/nuxt/plugins/defaultsWaitI18n`)
|
|
434
435
|
});
|
|
@@ -443,7 +444,7 @@ const module = defineNuxtModule({
|
|
|
443
444
|
src: resolve("./runtime/nuxt/plugins/titles")
|
|
444
445
|
});
|
|
445
446
|
}
|
|
446
|
-
if (!
|
|
447
|
+
if (!hasI18n) {
|
|
447
448
|
addImports({
|
|
448
449
|
from: resolve(`./runtime/nuxt/composables/polyfills`),
|
|
449
450
|
name: "useI18n"
|
|
@@ -29,16 +29,16 @@ export interface BreadcrumbProps {
|
|
|
29
29
|
* Append additional breadcrumb items to the end of the list. This is applied
|
|
30
30
|
* after the `overrides` option.
|
|
31
31
|
*/
|
|
32
|
-
append?: BreadcrumbItemProps[]
|
|
32
|
+
append?: MaybeRefOrGetter<BreadcrumbItemProps[]>;
|
|
33
33
|
/**
|
|
34
34
|
* Prepend additional breadcrumb items to the start of the list. This is applied
|
|
35
35
|
* after the `overrides` option.
|
|
36
36
|
*/
|
|
37
|
-
prepend?: BreadcrumbItemProps[]
|
|
37
|
+
prepend?: MaybeRefOrGetter<BreadcrumbItemProps[]>;
|
|
38
38
|
/**
|
|
39
39
|
* Override any of the breadcrumb items based on the index.
|
|
40
40
|
*/
|
|
41
|
-
overrides?: (BreadcrumbItemProps | false | undefined)[]
|
|
41
|
+
overrides?: MaybeRefOrGetter<(BreadcrumbItemProps | false | undefined)[]>;
|
|
42
42
|
/**
|
|
43
43
|
* Should the schema.org breadcrumb be generated.
|
|
44
44
|
* @default true
|
|
@@ -33,7 +33,7 @@ export function useBreadcrumbItems(options = {}) {
|
|
|
33
33
|
rootNode = `/${toValue(i18n.locale)}`;
|
|
34
34
|
}
|
|
35
35
|
const current = withoutQuery(withoutTrailingSlash(toValue(options.path || router.currentRoute.value?.path) || rootNode));
|
|
36
|
-
const overrides = options.overrides || [];
|
|
36
|
+
const overrides = toValue(options.overrides) || [];
|
|
37
37
|
const segments = pathBreadcrumbSegments(current, rootNode).map((path, index) => {
|
|
38
38
|
let item = {
|
|
39
39
|
to: path
|
|
@@ -46,15 +46,15 @@ export function useBreadcrumbItems(options = {}) {
|
|
|
46
46
|
return item;
|
|
47
47
|
});
|
|
48
48
|
if (options.prepend)
|
|
49
|
-
segments.unshift(...options.prepend);
|
|
49
|
+
segments.unshift(...toValue(options.prepend));
|
|
50
50
|
if (options.append)
|
|
51
|
-
segments.push(...options.append);
|
|
51
|
+
segments.push(...toValue(options.append));
|
|
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
55
|
const routeName = route ? String(route.name || route.path) : item.to === "/" ? "index" : "unknown";
|
|
56
56
|
let [name] = routeName.split("___");
|
|
57
|
-
if (name === "unknown" || name.includes("/"))
|
|
57
|
+
if (name === "unknown" || name.includes("/") || route.path?.includes(":"))
|
|
58
58
|
name = (item.to || "").split("/").pop() || "";
|
|
59
59
|
if (routeMeta.breadcrumb) {
|
|
60
60
|
item = {
|
|
@@ -17,6 +17,8 @@ export default defineNuxtPlugin(() => {
|
|
|
17
17
|
};
|
|
18
18
|
if (siteConfig.separator)
|
|
19
19
|
input.templateParams.separator = siteConfig.separator;
|
|
20
|
+
if (siteConfig.titleSeparator)
|
|
21
|
+
input.templateParams.titleSeparator = siteConfig.titleSeparator;
|
|
20
22
|
if (siteConfig.description) {
|
|
21
23
|
input.templateParams.siteDescription = siteConfig.description;
|
|
22
24
|
input.meta.push(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.1",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@nuxt/kit": "^3.13.2",
|
|
36
|
-
"@unhead/addons": "^1.11.
|
|
36
|
+
"@unhead/addons": "^1.11.10",
|
|
37
37
|
"defu": "^6.1.4",
|
|
38
38
|
"escape-string-regexp": "^5.0.0",
|
|
39
39
|
"fast-glob": "^3.3.2",
|
|
@@ -45,26 +45,26 @@
|
|
|
45
45
|
"ufo": "^1.5.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@antfu/eslint-config": "3.
|
|
48
|
+
"@antfu/eslint-config": "3.8.0",
|
|
49
49
|
"@nuxt/module-builder": "^0.8.4",
|
|
50
|
-
"@nuxt/test-utils": "^3.14.
|
|
51
|
-
"@nuxt/ui": "^2.18.
|
|
50
|
+
"@nuxt/test-utils": "^3.14.4",
|
|
51
|
+
"@nuxt/ui": "^2.18.7",
|
|
52
52
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
53
53
|
"@nuxtjs/i18n": "^8.5.5",
|
|
54
|
-
"@unhead/shared": "^1.11.
|
|
54
|
+
"@unhead/shared": "^1.11.10",
|
|
55
55
|
"@vue/test-utils": "^2.4.6",
|
|
56
|
-
"bumpp": "^9.
|
|
56
|
+
"bumpp": "^9.7.1",
|
|
57
57
|
"case-police": "^0.7.0",
|
|
58
58
|
"cheerio": "1.0.0",
|
|
59
|
-
"eslint": "^9.
|
|
59
|
+
"eslint": "^9.13.0",
|
|
60
60
|
"happy-dom": "^15.7.4",
|
|
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.
|
|
65
|
-
"sass": "^1.
|
|
66
|
-
"typescript": "5.6.
|
|
67
|
-
"vitest": "^2.1.
|
|
64
|
+
"playwright-core": "^1.48.1",
|
|
65
|
+
"sass": "^1.80.3",
|
|
66
|
+
"typescript": "5.6.3",
|
|
67
|
+
"vitest": "^2.1.3"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"lint": "eslint . --fix",
|