nuxt-seo-utils 7.0.15 → 7.0.17
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.d.mts +115 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +562 -0
- package/dist/runtime/app/composables/polyfills.d.ts +11 -0
- package/dist/runtime/app/composables/polyfills.js +27 -0
- package/dist/runtime/app/composables/useBreadcrumbItems.d.ts +112 -0
- package/dist/runtime/app/composables/useBreadcrumbItems.js +193 -0
- package/dist/runtime/app/logic/applyDefaults.d.ts +1 -0
- package/dist/runtime/app/logic/applyDefaults.js +78 -0
- package/dist/runtime/app/plugins/0.routeRules.d.ts +2 -0
- package/dist/runtime/app/plugins/0.routeRules.js +24 -0
- package/dist/runtime/app/plugins/1.absoluteImageUrls.server.d.ts +2 -0
- package/dist/runtime/app/plugins/1.absoluteImageUrls.server.js +33 -0
- package/dist/runtime/app/plugins/defaults.d.ts +2 -0
- package/dist/runtime/app/plugins/defaults.js +12 -0
- package/dist/runtime/app/plugins/defaultsWaitI18n.d.ts +2 -0
- package/dist/runtime/app/plugins/defaultsWaitI18n.js +13 -0
- package/dist/runtime/app/plugins/inferSeoMetaPlugin.d.ts +2 -0
- package/dist/runtime/app/plugins/inferSeoMetaPlugin.js +11 -0
- package/dist/runtime/app/plugins/siteConfig.d.ts +2 -0
- package/dist/runtime/app/plugins/siteConfig.js +33 -0
- package/dist/runtime/app/plugins/titles.d.ts +2 -0
- package/dist/runtime/app/plugins/titles.js +30 -0
- package/dist/runtime/server/middleware/redirectCanonical.d.ts +2 -0
- package/dist/runtime/server/middleware/redirectCanonical.js +28 -0
- package/dist/runtime/server/middleware/resolveImagesInPagesDir.d.ts +2 -0
- package/dist/runtime/server/middleware/resolveImagesInPagesDir.js +16 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/shared/breadcrumbs.d.ts +1 -0
- package/dist/runtime/shared/breadcrumbs.js +18 -0
- package/dist/runtime/types.d.ts +6 -0
- package/dist/runtime/types.js +0 -0
- package/dist/types.d.mts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { hasTrailingSlash, parseURL, stringifyParsedURL, withTrailingSlash } from "ufo";
|
|
2
|
+
export function pathBreadcrumbSegments(path, rootNode = "/") {
|
|
3
|
+
const startNode = parseURL(path);
|
|
4
|
+
const appendsTrailingSlash = hasTrailingSlash(startNode.pathname);
|
|
5
|
+
const stepNode = (node, nodes = []) => {
|
|
6
|
+
const fullPath = stringifyParsedURL(node);
|
|
7
|
+
const currentPathName = node.pathname || "/";
|
|
8
|
+
nodes.push(fullPath || "/");
|
|
9
|
+
if (currentPathName !== rootNode && currentPathName !== "/") {
|
|
10
|
+
node.pathname = currentPathName.substring(0, currentPathName.lastIndexOf("/"));
|
|
11
|
+
if (appendsTrailingSlash)
|
|
12
|
+
node.pathname = withTrailingSlash(node.pathname.substring(0, node.pathname.lastIndexOf("/")));
|
|
13
|
+
stepNode(node, nodes);
|
|
14
|
+
}
|
|
15
|
+
return nodes;
|
|
16
|
+
};
|
|
17
|
+
return stepNode(startNode).reverse();
|
|
18
|
+
}
|
|
File without changes
|
package/dist/types.d.mts
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.17",
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"escape-string-regexp": "^5.0.0",
|
|
39
39
|
"fast-glob": "^3.3.3",
|
|
40
40
|
"image-size": "^2.0.2",
|
|
41
|
-
"nuxt-site-config": "^3.2.
|
|
41
|
+
"nuxt-site-config": "^3.2.8",
|
|
42
42
|
"pathe": "^2.0.3",
|
|
43
43
|
"pkg-types": "^2.3.0",
|
|
44
44
|
"scule": "^1.3.0",
|