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.
Files changed (34) hide show
  1. package/dist/module.d.mts +115 -0
  2. package/dist/module.json +12 -0
  3. package/dist/module.mjs +562 -0
  4. package/dist/runtime/app/composables/polyfills.d.ts +11 -0
  5. package/dist/runtime/app/composables/polyfills.js +27 -0
  6. package/dist/runtime/app/composables/useBreadcrumbItems.d.ts +112 -0
  7. package/dist/runtime/app/composables/useBreadcrumbItems.js +193 -0
  8. package/dist/runtime/app/logic/applyDefaults.d.ts +1 -0
  9. package/dist/runtime/app/logic/applyDefaults.js +78 -0
  10. package/dist/runtime/app/plugins/0.routeRules.d.ts +2 -0
  11. package/dist/runtime/app/plugins/0.routeRules.js +24 -0
  12. package/dist/runtime/app/plugins/1.absoluteImageUrls.server.d.ts +2 -0
  13. package/dist/runtime/app/plugins/1.absoluteImageUrls.server.js +33 -0
  14. package/dist/runtime/app/plugins/defaults.d.ts +2 -0
  15. package/dist/runtime/app/plugins/defaults.js +12 -0
  16. package/dist/runtime/app/plugins/defaultsWaitI18n.d.ts +2 -0
  17. package/dist/runtime/app/plugins/defaultsWaitI18n.js +13 -0
  18. package/dist/runtime/app/plugins/inferSeoMetaPlugin.d.ts +2 -0
  19. package/dist/runtime/app/plugins/inferSeoMetaPlugin.js +11 -0
  20. package/dist/runtime/app/plugins/siteConfig.d.ts +2 -0
  21. package/dist/runtime/app/plugins/siteConfig.js +33 -0
  22. package/dist/runtime/app/plugins/titles.d.ts +2 -0
  23. package/dist/runtime/app/plugins/titles.js +30 -0
  24. package/dist/runtime/server/middleware/redirectCanonical.d.ts +2 -0
  25. package/dist/runtime/server/middleware/redirectCanonical.js +28 -0
  26. package/dist/runtime/server/middleware/resolveImagesInPagesDir.d.ts +2 -0
  27. package/dist/runtime/server/middleware/resolveImagesInPagesDir.js +16 -0
  28. package/dist/runtime/server/tsconfig.json +3 -0
  29. package/dist/runtime/shared/breadcrumbs.d.ts +1 -0
  30. package/dist/runtime/shared/breadcrumbs.js +18 -0
  31. package/dist/runtime/types.d.ts +6 -0
  32. package/dist/runtime/types.js +0 -0
  33. package/dist/types.d.mts +3 -0
  34. 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
+ }
@@ -0,0 +1,6 @@
1
+ import type { Head, MetaFlat, RawInput } from '@unhead/vue/types';
2
+ export type MetaFlatSerializable = MetaFlat & {
3
+ title?: RawInput<'title'>;
4
+ titleTemplate?: RawInput<'titleTemplate'>;
5
+ };
6
+ export type { Head };
File without changes
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-seo-utils",
3
3
  "type": "module",
4
- "version": "7.0.15",
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.5",
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",