nuxt-seo-utils 5.0.0

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 (38) hide show
  1. package/README.md +61 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +103 -0
  4. package/dist/module.d.ts +103 -0
  5. package/dist/module.json +13 -0
  6. package/dist/module.mjs +531 -0
  7. package/dist/runtime/nitro/middleware/redirectNitroOrigin.d.ts +2 -0
  8. package/dist/runtime/nitro/middleware/redirectNitroOrigin.js +18 -0
  9. package/dist/runtime/nitro/middleware/resolveImagesInPagesDir.dev.d.ts +2 -0
  10. package/dist/runtime/nitro/middleware/resolveImagesInPagesDir.dev.js +17 -0
  11. package/dist/runtime/nitro/tsconfig.json +3 -0
  12. package/dist/runtime/nuxt/composables/polyfills.d.ts +11 -0
  13. package/dist/runtime/nuxt/composables/polyfills.js +21 -0
  14. package/dist/runtime/nuxt/composables/useBreadcrumbItems.d.ts +95 -0
  15. package/dist/runtime/nuxt/composables/useBreadcrumbItems.js +98 -0
  16. package/dist/runtime/nuxt/logic/applyDefaults.d.ts +4 -0
  17. package/dist/runtime/nuxt/logic/applyDefaults.js +48 -0
  18. package/dist/runtime/nuxt/plugins/0.routeRules.server.d.ts +2 -0
  19. package/dist/runtime/nuxt/plugins/0.routeRules.server.js +21 -0
  20. package/dist/runtime/nuxt/plugins/1.absoluteImageUrls.server.d.ts +2 -0
  21. package/dist/runtime/nuxt/plugins/1.absoluteImageUrls.server.js +31 -0
  22. package/dist/runtime/nuxt/plugins/defaults.d.ts +2 -0
  23. package/dist/runtime/nuxt/plugins/defaults.js +20 -0
  24. package/dist/runtime/nuxt/plugins/defaultsWaitI18n.d.ts +2 -0
  25. package/dist/runtime/nuxt/plugins/defaultsWaitI18n.js +23 -0
  26. package/dist/runtime/nuxt/plugins/inferSeoMetaPlugin.d.ts +2 -0
  27. package/dist/runtime/nuxt/plugins/inferSeoMetaPlugin.js +9 -0
  28. package/dist/runtime/nuxt/plugins/siteConfig.d.ts +2 -0
  29. package/dist/runtime/nuxt/plugins/siteConfig.js +30 -0
  30. package/dist/runtime/nuxt/plugins/titles.d.ts +2 -0
  31. package/dist/runtime/nuxt/plugins/titles.js +29 -0
  32. package/dist/runtime/pure/breadcrumbs.d.ts +1 -0
  33. package/dist/runtime/pure/breadcrumbs.js +18 -0
  34. package/dist/runtime/types.d.ts +1 -0
  35. package/dist/runtime/types.js +0 -0
  36. package/dist/types.d.mts +1 -0
  37. package/dist/types.d.ts +1 -0
  38. package/package.json +83 -0
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ <h1 align='center'>nuxt-seo-utils</h1>
2
+
3
+ <p align="center">
4
+ <a href='https://github.com/harlan-zw/nuxt-seo-utils/actions/workflows/test.yml'>
5
+ </a>
6
+ <a href="https://www.npmjs.com/package/nuxt-seo-utils" target="__blank"><img src="https://img.shields.io/npm/v/nuxt-seo-utils?style=flat&colorA=002438&colorB=28CF8D" alt="NPM version"></a>
7
+ <a href="https://www.npmjs.com/package/nuxt-seo-utils" target="__blank"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/nuxt-seo-utils?flat&colorA=002438&colorB=28CF8D"></a>
8
+ <a href="https://github.com/harlan-zw/nuxt-seo-utils" target="__blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/harlan-zw/nuxt-seo-utils?flat&colorA=002438&colorB=28CF8D"></a>
9
+ </p>
10
+
11
+ <p align="center">
12
+ SEO utilities for Nuxt to help you make your site more discoverable and shareable.
13
+ </p>
14
+
15
+ <p align="center">
16
+ <table>
17
+ <tbody>
18
+ <td align="center">
19
+ <img width="800" height="0" /><br>
20
+ <i>Status:</i> <a href="https://github.com/harlan-zw/nuxt-seo-utils/releases/tag/v3.0.0">v3 Released</a> <br>
21
+ <sup> Please report any issues 🐛</sup><br>
22
+ <sub>Made possible by my <a href="https://github.com/sponsors/harlan-zw">Sponsor Program 💖</a><br> Follow me <a href="https://twitter.com/harlan_zw">@harlan_zw</a> 🐦 • Join <a href="https://discord.gg/275MBUBvgP">Discord</a> for help</sub><br>
23
+ <img width="800" height="0" />
24
+ </td>
25
+ </tbody>
26
+ </table>
27
+ </p>
28
+
29
+ ## Features
30
+
31
+ - ▲ Next.js inspired [Metadata Files](https://nextjs.org/docs/app/api-reference/file-conventions/metadata)
32
+ - ✨ Use SEO meta in your nuxt.config (`app.seoMeta`) and route rules
33
+ - 🤖 Adds meta tags (`og:title`, `og:description`, etc.) from page title and description
34
+ - 🧙 Correct tags that need to be absolute (i.e `og:image`)
35
+ - 🧩 Site config template params `useHead({ title: '%site.title' })`
36
+ - 🍞 Breadcrumb composable
37
+ - 🧙 Best practice defaults and enhanced titles
38
+
39
+ ## Installation
40
+
41
+ Install `nuxt-seo-utils` dependency to your project:
42
+
43
+ ```bash
44
+ npx nuxi@latest module add nuxt-seo-utils
45
+ ```
46
+
47
+ # Documentation
48
+
49
+ [📖 Read the full documentation](https://nuxtseo.com/docs/utils) for more information.
50
+
51
+ ## Sponsors
52
+
53
+ <p align="center">
54
+ <a href="https://raw.githubusercontent.com/harlan-zw/static/main/sponsors.svg">
55
+ <img src='https://raw.githubusercontent.com/harlan-zw/static/main/sponsors.svg'/>
56
+ </a>
57
+ </p>
58
+
59
+ ## License
60
+
61
+ MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,103 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ /**
5
+ * Whether the SEO experiements should run.
6
+ *
7
+ * @default true
8
+ */
9
+ enabled: boolean;
10
+ /**
11
+ * Should the files in the public directory be used to infer tags such as favicon, apple-touch-icon, and
12
+ * open graph images.
13
+ *
14
+ * @default true
15
+ */
16
+ metaDataFiles: boolean;
17
+ /**
18
+ * Should head data be inferred from the current input to fill in the gaps.
19
+ *
20
+ * For example:
21
+ * - If you supply a title, this will automatically add an og:title.
22
+ * - If you provide an og:image, it will automatically add a twitter:image.
23
+ *
24
+ * @default true
25
+ */
26
+ automaticOgAndTwitterTags: boolean;
27
+ /**
28
+ * Attempts to treeshake the `useSeoMeta` function. Can save around 5kb in the client bundle.
29
+ *
30
+ * @default true
31
+ */
32
+ treeShakeUseSeoMeta: boolean;
33
+ /**
34
+ * Injects site config into the `useHead` composable such as setting the title template
35
+ *
36
+ * @default true
37
+ */
38
+ mergeWithSiteConfig: boolean;
39
+ /**
40
+ * Adds `head` and `seoMeta` to the route rules and app config.
41
+ *
42
+ * @default true
43
+ */
44
+ extendRouteRules: boolean;
45
+ /**
46
+ * Tries to convert relative image paths to absolute paths in meta tags.
47
+ *
48
+ * @default true
49
+ */
50
+ fixRequiredAbsoluteMetaTagsLinks: boolean;
51
+ /**
52
+ * Extends the `head` in the Nuxt config with the `seoMeta` object.
53
+ *
54
+ * @default true
55
+ */
56
+ extendNuxtConfigAppHeadSeoMeta: boolean;
57
+ /**
58
+ * Augments the head schema with `/public` files making it easier to reference them in the head.
59
+ *
60
+ * @default true
61
+ */
62
+ extendNuxtConfigAppHeadTypes: boolean;
63
+ /**
64
+ * @dead
65
+ */
66
+ setupNuxtConfigAppHeadWithMoreDefaults: boolean;
67
+ /**
68
+ * Will ensure a title is always set by providing a fallback title based on the casing the last slug segment.
69
+ *
70
+ * @default true
71
+ */
72
+ fallbackTitle?: boolean;
73
+ /**
74
+ * Will set up a number of defaults for meta tags and Schema.org, if the modules and config are available.
75
+ *
76
+ * @default true
77
+ */
78
+ automaticDefaults?: boolean;
79
+ /**
80
+ * When enabled, it will whitelist the query parameters that are allowed in the canonical URL.
81
+ */
82
+ canonicalQueryWhitelist?: string[];
83
+ /**
84
+ * When enabled, it will redirect any request to the canonical domain (site url) using a 301 redirect on non-dev environments.
85
+ *
86
+ * E.g if the site url is 'www.example.com' and the user visits 'example.com',
87
+ * they will be redirected to 'www.example.com'.
88
+ *
89
+ * This is useful for SEO as it prevents duplicate content and consolidates page rank.
90
+ *
91
+ * @default false
92
+ */
93
+ redirectToCanonicalSiteUrl?: boolean;
94
+ /**
95
+ * Enables debug logs and a debug endpoint.
96
+ *
97
+ * @default false
98
+ */
99
+ debug: boolean;
100
+ }
101
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
102
+
103
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,103 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ /**
5
+ * Whether the SEO experiements should run.
6
+ *
7
+ * @default true
8
+ */
9
+ enabled: boolean;
10
+ /**
11
+ * Should the files in the public directory be used to infer tags such as favicon, apple-touch-icon, and
12
+ * open graph images.
13
+ *
14
+ * @default true
15
+ */
16
+ metaDataFiles: boolean;
17
+ /**
18
+ * Should head data be inferred from the current input to fill in the gaps.
19
+ *
20
+ * For example:
21
+ * - If you supply a title, this will automatically add an og:title.
22
+ * - If you provide an og:image, it will automatically add a twitter:image.
23
+ *
24
+ * @default true
25
+ */
26
+ automaticOgAndTwitterTags: boolean;
27
+ /**
28
+ * Attempts to treeshake the `useSeoMeta` function. Can save around 5kb in the client bundle.
29
+ *
30
+ * @default true
31
+ */
32
+ treeShakeUseSeoMeta: boolean;
33
+ /**
34
+ * Injects site config into the `useHead` composable such as setting the title template
35
+ *
36
+ * @default true
37
+ */
38
+ mergeWithSiteConfig: boolean;
39
+ /**
40
+ * Adds `head` and `seoMeta` to the route rules and app config.
41
+ *
42
+ * @default true
43
+ */
44
+ extendRouteRules: boolean;
45
+ /**
46
+ * Tries to convert relative image paths to absolute paths in meta tags.
47
+ *
48
+ * @default true
49
+ */
50
+ fixRequiredAbsoluteMetaTagsLinks: boolean;
51
+ /**
52
+ * Extends the `head` in the Nuxt config with the `seoMeta` object.
53
+ *
54
+ * @default true
55
+ */
56
+ extendNuxtConfigAppHeadSeoMeta: boolean;
57
+ /**
58
+ * Augments the head schema with `/public` files making it easier to reference them in the head.
59
+ *
60
+ * @default true
61
+ */
62
+ extendNuxtConfigAppHeadTypes: boolean;
63
+ /**
64
+ * @dead
65
+ */
66
+ setupNuxtConfigAppHeadWithMoreDefaults: boolean;
67
+ /**
68
+ * Will ensure a title is always set by providing a fallback title based on the casing the last slug segment.
69
+ *
70
+ * @default true
71
+ */
72
+ fallbackTitle?: boolean;
73
+ /**
74
+ * Will set up a number of defaults for meta tags and Schema.org, if the modules and config are available.
75
+ *
76
+ * @default true
77
+ */
78
+ automaticDefaults?: boolean;
79
+ /**
80
+ * When enabled, it will whitelist the query parameters that are allowed in the canonical URL.
81
+ */
82
+ canonicalQueryWhitelist?: string[];
83
+ /**
84
+ * When enabled, it will redirect any request to the canonical domain (site url) using a 301 redirect on non-dev environments.
85
+ *
86
+ * E.g if the site url is 'www.example.com' and the user visits 'example.com',
87
+ * they will be redirected to 'www.example.com'.
88
+ *
89
+ * This is useful for SEO as it prevents duplicate content and consolidates page rank.
90
+ *
91
+ * @default false
92
+ */
93
+ redirectToCanonicalSiteUrl?: boolean;
94
+ /**
95
+ * Enables debug logs and a debug endpoint.
96
+ *
97
+ * @default false
98
+ */
99
+ debug: boolean;
100
+ }
101
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
102
+
103
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "nuxt-seo-utils",
3
+ "configKey": "seo",
4
+ "compatibility": {
5
+ "nuxt": ">=3.6.1",
6
+ "bridge": false
7
+ },
8
+ "version": "4.0.1",
9
+ "builder": {
10
+ "@nuxt/module-builder": "0.8.4",
11
+ "unbuild": "2.0.0"
12
+ }
13
+ }