nuxt-seo-utils 6.0.5 → 6.0.6

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/LICENSE.md CHANGED
@@ -1,9 +1,9 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Harlan Wilton
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Harlan Wilton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,74 +1,74 @@
1
- <h1>nuxt-seo-utils</h1>
2
-
3
- [![npm version][npm-version-src]][npm-version-href]
4
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
- [![License][license-src]][license-href]
6
- [![Nuxt][nuxt-src]][nuxt-href]
7
-
8
- Nuxt SEO Utils is a collection of defaults and utilities to improve your Nuxt site's discoverability and shareability.
9
-
10
- While there are several features covering many aspects of SEO, it covers important defaults such as [automatic canonical URLs](https://nuxtseo.com/learn/controlling-crawlers/canonical-urls) and
11
- [open graph tags](https://nuxtseo.com/learn/mastering-meta/open-graph).
12
-
13
- <p align="center">
14
- <table>
15
- <tbody>
16
- <td align="center">
17
- <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>
18
- </td>
19
- </tbody>
20
- </table>
21
- </p>
22
-
23
- ## Features
24
-
25
- - ▲ Next.js inspired [Metadata Files](https://nextjs.org/docs/app/api-reference/file-conventions/metadata)
26
- - ✨ Use SEO meta in your nuxt.config (`app.seoMeta`) and route rules
27
- - 🤖 Adds meta tags (`og:title`, `og:description`, etc.) from page title and description
28
- - 🧙 Correct tags that need to be absolute (i.e `og:image`)
29
- - 🧩 Site config template params `useHead({ title: '%site.title' })`
30
- - 🍞 Breadcrumb composable
31
- - 🧙 Best practice defaults and enhanced titles
32
-
33
- ## Installation
34
-
35
- Install `nuxt-seo-utils` dependency to your project:
36
-
37
- ```bash
38
- npx nuxi@latest module add nuxt-seo-utils
39
- ```
40
-
41
- 💡 Need a complete SEO solution for Nuxt? Check out [Nuxt SEO](https://nuxtseo.com).
42
-
43
- ## Documentation
44
-
45
- [📖 Read the full documentation](https://nuxtseo.com/docs/utils) for more information.
46
-
47
- ## Demos
48
-
49
- [Basic](https://stackblitz.com/edit/nuxt-starter-vbay3q?file=app.vue)
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
- Licensed under the [MIT license](https://github.com/harlan-zw/nuxt-seo-utils/blob/main/LICENSE.md).
62
-
63
- <!-- Badges -->
64
- [npm-version-src]: https://img.shields.io/npm/v/nuxt-seo-utils/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
65
- [npm-version-href]: https://npmjs.com/package/nuxt-seo-utils
66
-
67
- [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-seo-utils.svg?style=flat&colorA=18181B&colorB=28CF8D
68
- [npm-downloads-href]: https://npmjs.com/package/nuxt-seo-utils
69
-
70
- [license-src]: https://img.shields.io/github/license/harlan-zw/nuxt-seo-utils.svg?style=flat&colorA=18181B&colorB=28CF8D
71
- [license-href]: https://github.com/harlan-zw/nuxt-seo-utils/blob/main/LICENSE.md
72
-
73
- [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
74
- [nuxt-href]: https://nuxt.com
1
+ <h1>nuxt-seo-utils</h1>
2
+
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![License][license-src]][license-href]
6
+ [![Nuxt][nuxt-src]][nuxt-href]
7
+
8
+ Nuxt SEO Utils is a collection of defaults and utilities to improve your Nuxt site's discoverability and shareability.
9
+
10
+ While there are several features covering many aspects of SEO, it covers important defaults such as [automatic canonical URLs](https://nuxtseo.com/learn/controlling-crawlers/canonical-urls) and
11
+ [open graph tags](https://nuxtseo.com/learn/mastering-meta/open-graph).
12
+
13
+ <p align="center">
14
+ <table>
15
+ <tbody>
16
+ <td align="center">
17
+ <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>
18
+ </td>
19
+ </tbody>
20
+ </table>
21
+ </p>
22
+
23
+ ## Features
24
+
25
+ - ▲ Next.js inspired [Metadata Files](https://nextjs.org/docs/app/api-reference/file-conventions/metadata)
26
+ - ✨ Use SEO meta in your nuxt.config (`app.seoMeta`) and route rules
27
+ - 🤖 Adds meta tags (`og:title`, `og:description`, etc.) from page title and description
28
+ - 🧙 Correct tags that need to be absolute (i.e `og:image`)
29
+ - 🧩 Site config template params `useHead({ title: '%site.title' })`
30
+ - 🍞 Breadcrumb composable
31
+ - 🧙 Best practice defaults and enhanced titles
32
+
33
+ ## Installation
34
+
35
+ Install `nuxt-seo-utils` dependency to your project:
36
+
37
+ ```bash
38
+ npx nuxi@latest module add nuxt-seo-utils
39
+ ```
40
+
41
+ 💡 Need a complete SEO solution for Nuxt? Check out [Nuxt SEO](https://nuxtseo.com).
42
+
43
+ ## Documentation
44
+
45
+ [📖 Read the full documentation](https://nuxtseo.com/docs/utils) for more information.
46
+
47
+ ## Demos
48
+
49
+ [Basic](https://stackblitz.com/edit/nuxt-starter-vbay3q?file=app.vue)
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
+ Licensed under the [MIT license](https://github.com/harlan-zw/nuxt-seo-utils/blob/main/LICENSE.md).
62
+
63
+ <!-- Badges -->
64
+ [npm-version-src]: https://img.shields.io/npm/v/nuxt-seo-utils/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
65
+ [npm-version-href]: https://npmjs.com/package/nuxt-seo-utils
66
+
67
+ [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-seo-utils.svg?style=flat&colorA=18181B&colorB=28CF8D
68
+ [npm-downloads-href]: https://npmjs.com/package/nuxt-seo-utils
69
+
70
+ [license-src]: https://img.shields.io/github/license/harlan-zw/nuxt-seo-utils.svg?style=flat&colorA=18181B&colorB=28CF8D
71
+ [license-href]: https://github.com/harlan-zw/nuxt-seo-utils/blob/main/LICENSE.md
72
+
73
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
74
+ [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.6.1",
6
6
  "bridge": false
7
7
  },
8
- "version": "6.0.4",
8
+ "version": "6.0.5",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.4",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -15,20 +15,19 @@ import imageSize from 'image-size';
15
15
  function extendNuxtConfigAppHeadSeoMeta(nuxt = useNuxt()) {
16
16
  const seoMeta = nuxt.options.app?.seoMeta || nuxt.options.app?.head?.seoMeta || false;
17
17
  const configSeoMeta = nuxt.options.seo?.meta || false;
18
- if (!seoMeta)
18
+ if (!seoMeta && !configSeoMeta)
19
19
  return;
20
20
  nuxt.options.app.head = nuxt.options.app.head || {};
21
21
  nuxt.options.app.head = {
22
22
  ...nuxt.options.app.head,
23
23
  meta: [
24
24
  ...nuxt.options.app.head.meta || [],
25
- ...unpackMeta(seoMeta),
26
- ...unpackMeta(configSeoMeta)
25
+ ...unpackMeta(seoMeta || {}),
26
+ ...unpackMeta(configSeoMeta || {})
27
27
  ]
28
28
  };
29
29
  delete nuxt.options.app.seoMeta;
30
30
  delete nuxt.options.app.head.seoMeta;
31
- return nuxt.options.app.head;
32
31
  }
33
32
 
34
33
  function extendTypes(module, template) {
@@ -1,5 +1,5 @@
1
1
  import { useHead } from "@unhead/vue";
2
- import { defineNuxtPlugin, useRoute } from "nuxt/app";
2
+ import { defineNuxtPlugin, useError, useRoute } from "nuxt/app";
3
3
  import { titleCase } from "scule";
4
4
  import { withoutTrailingSlash } from "ufo";
5
5
  import { computed } from "vue";
@@ -10,7 +10,11 @@ export default defineNuxtPlugin({
10
10
  },
11
11
  setup() {
12
12
  const route = useRoute();
13
+ const err = useError();
13
14
  const title = computed(() => {
15
+ if ([404, 500].includes(err.value?.statusCode)) {
16
+ return `${err.value.statusCode} - ${err.value.message}`;
17
+ }
14
18
  if (typeof route.meta?.title === "string")
15
19
  return route.meta?.title;
16
20
  const path = withoutTrailingSlash(route.path || "/");
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json"
3
- }
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json"
3
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-seo-utils",
3
3
  "type": "module",
4
- "version": "6.0.5",
4
+ "version": "6.0.6",
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",
@@ -32,38 +32,38 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@nuxt/kit": "^3.14.1592",
36
- "@unhead/addons": "^1.11.13",
37
- "@unhead/schema": "^1.11.13",
35
+ "@nuxt/kit": "^3.15.1",
36
+ "@unhead/addons": "^1.11.16",
37
+ "@unhead/schema": "^1.11.16",
38
38
  "defu": "^6.1.4",
39
39
  "escape-string-regexp": "^5.0.0",
40
- "fast-glob": "^3.3.2",
41
- "image-size": "^1.1.1",
42
- "mlly": "^1.7.3",
43
- "nuxt-site-config": "^3.0.4",
44
- "pathe": "^1.1.2",
40
+ "fast-glob": "^3.3.3",
41
+ "image-size": "^1.2.0",
42
+ "mlly": "^1.7.4",
43
+ "nuxt-site-config": "^3.0.6",
44
+ "pathe": "^2.0.1",
45
45
  "scule": "^1.3.0",
46
46
  "ufo": "^1.5.4"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@antfu/eslint-config": "3.11.2",
50
50
  "@nuxt/module-builder": "^0.8.4",
51
- "@nuxt/test-utils": "^3.15.1",
52
- "@nuxt/ui": "^2.19.2",
51
+ "@nuxt/test-utils": "^3.15.4",
52
+ "@nuxt/ui": "^2.20.0",
53
53
  "@nuxtjs/eslint-config-typescript": "^12.1.0",
54
54
  "@nuxtjs/i18n": "^9.1.1",
55
- "@unhead/shared": "^1.11.13",
55
+ "@unhead/shared": "^1.11.16",
56
56
  "@vue/test-utils": "^2.4.6",
57
- "bumpp": "^9.8.1",
57
+ "bumpp": "^9.10.0",
58
58
  "case-police": "^0.7.2",
59
59
  "cheerio": "1.0.0",
60
- "eslint": "^9.16.0",
61
- "happy-dom": "^15.11.7",
60
+ "eslint": "^9.18.0",
61
+ "happy-dom": "^16.5.3",
62
62
  "markdownlint-cli": "^0.43.0",
63
- "nuxt": "^3.14.1592",
63
+ "nuxt": "^3.15.1",
64
64
  "nuxt-content-twoslash": "^0.1.2",
65
- "playwright-core": "^1.49.0",
66
- "sass": "^1.82.0",
65
+ "playwright-core": "^1.49.1",
66
+ "sass": "^1.83.3",
67
67
  "typescript": "5.6.3",
68
68
  "vitest": "^2.1.8"
69
69
  },