@nuxtjs/seo 2.0.0-rc.10 → 2.0.0-rc.12
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/README.md +7 -12
- package/dist/module.json +6 -2
- package/dist/module.mjs +4 -3
- package/dist/runtime/nitro/middleware/redirect.js +18 -0
- package/dist/runtime/nuxt/composables/polyfills.d.ts +2 -2
- package/dist/runtime/nuxt/composables/useBreadcrumbItems.d.ts +1 -1
- package/dist/runtime/nuxt/composables/{useBreadcrumbItems.mjs → useBreadcrumbItems.js} +2 -2
- package/dist/runtime/nuxt/plugin/defaults.d.ts +1 -1
- package/dist/runtime/nuxt/plugin/{defaults.mjs → defaults.js} +1 -1
- package/dist/runtime/nuxt/plugin/defaultsWaitI18n.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugin/{defaultsWaitI18n.server.mjs → defaultsWaitI18n.server.js} +1 -1
- package/dist/runtime/nuxt/plugin/titles.d.ts +1 -1
- package/dist/types.d.mts +1 -16
- package/dist/types.d.ts +1 -16
- package/package.json +26 -26
- package/dist/runtime/nitro/middleware/redirect.mjs +0 -13
- /package/dist/runtime/nuxt/composables/{polyfills.mjs → polyfills.js} +0 -0
- /package/dist/runtime/nuxt/logic/{applyDefaults.mjs → applyDefaults.js} +0 -0
- /package/dist/runtime/nuxt/plugin/{titles.mjs → titles.js} +0 -0
- /package/dist/runtime/pure/{breadcrumbs.mjs → breadcrumbs.js} +0 -0
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ With powerful APIs built for fully dynamic sites and zero-config defaults for st
|
|
|
40
40
|
|
|
41
41
|
- 📖 [@nuxtjs/sitemap](https://github.com/nuxt-modules/sitemap) - Sitemap.xml Support
|
|
42
42
|
- 🤖 [nuxt-simple-robots](https://github.com/harlan-zw/nuxt-simple-robots) - Manage site crawling
|
|
43
|
-
- 🔎 [nuxt-schema-org](https://
|
|
43
|
+
- 🔎 [nuxt-schema-org](https://github.com/harlan-zw/nuxt-schema-org) - Generate Schema.org JSON-LD for SEO
|
|
44
44
|
- △ [nuxt-seo-experiments](https://github.com/harlan-zw/nuxt-seo-experiments) - Experimental SEO meta features
|
|
45
45
|
- 🖼️ [nuxt-og-image](https://github.com/nuxt-modules/og-image) - Generate dynamic social share images
|
|
46
46
|
- ✅ [nuxt-link-checker](https://github.com/harlan-zw/nuxt-link-checker) - Check for broken links
|
|
@@ -50,23 +50,18 @@ With powerful APIs built for fully dynamic sites and zero-config defaults for st
|
|
|
50
50
|
1. Install `@nuxtjs/seo` dependency to your project:
|
|
51
51
|
|
|
52
52
|
```sh
|
|
53
|
-
|
|
54
|
-
yarn add -D @nuxtjs/seo
|
|
55
|
-
npm install -D @nuxtjs/seo
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
2. Add it to your `modules` section in your `nuxt.config`:
|
|
59
|
-
|
|
60
|
-
```ts [nuxt.config]
|
|
61
|
-
export default defineNuxtConfig({
|
|
62
|
-
modules: ['@nuxtjs/seo']
|
|
63
|
-
})
|
|
53
|
+
npx nuxi@latest module add seo
|
|
64
54
|
```
|
|
65
55
|
|
|
66
56
|
That's it!
|
|
67
57
|
|
|
68
58
|
All features are enabled by default. Learn more by exploring the [documentation](https://nuxtseo.com)
|
|
69
59
|
|
|
60
|
+
## Stackblitz
|
|
61
|
+
|
|
62
|
+
For reproductions and demo environments, you can use the [Nuxt SEO Basic Reproduction](https://stackblitz.com/edit/nuxt-starter-gfrej6?file=nuxt.config.ts)
|
|
63
|
+
template.
|
|
64
|
+
|
|
70
65
|
## Sponsors
|
|
71
66
|
|
|
72
67
|
<p align="center">
|
package/dist/module.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxtseo",
|
|
3
3
|
"compatibility": {
|
|
4
|
-
"nuxt": "
|
|
4
|
+
"nuxt": ">=3.7.0",
|
|
5
5
|
"bridge": false
|
|
6
6
|
},
|
|
7
7
|
"configKey": "seo",
|
|
8
|
-
"version": "2.0.0-rc.
|
|
8
|
+
"version": "2.0.0-rc.11",
|
|
9
|
+
"builder": {
|
|
10
|
+
"@nuxt/module-builder": "0.8.1",
|
|
11
|
+
"unbuild": "2.0.0"
|
|
12
|
+
}
|
|
9
13
|
}
|
package/dist/module.mjs
CHANGED
|
@@ -16,7 +16,7 @@ const module = defineNuxtModule({
|
|
|
16
16
|
meta: {
|
|
17
17
|
name: "nuxtseo",
|
|
18
18
|
compatibility: {
|
|
19
|
-
nuxt: "
|
|
19
|
+
nuxt: ">=3.7.0",
|
|
20
20
|
bridge: false
|
|
21
21
|
},
|
|
22
22
|
configKey: "seo"
|
|
@@ -26,7 +26,8 @@ const module = defineNuxtModule({
|
|
|
26
26
|
enabled: true,
|
|
27
27
|
debug: nuxt.options.debug,
|
|
28
28
|
redirectToCanonicalSiteUrl: false,
|
|
29
|
-
splash:
|
|
29
|
+
splash: false,
|
|
30
|
+
// nuxt.options.dev, - figure out a solution for this in the future
|
|
30
31
|
automaticDefaults: true,
|
|
31
32
|
fallbackTitle: true
|
|
32
33
|
};
|
|
@@ -88,7 +89,7 @@ const module = defineNuxtModule({
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
nuxt.options.experimental.headNext = true;
|
|
91
|
-
if (config.redirectToCanonicalSiteUrl) {
|
|
92
|
+
if (!nuxt.options.dev && config.redirectToCanonicalSiteUrl) {
|
|
92
93
|
addServerHandler({
|
|
93
94
|
handler: resolve("./runtime/nitro/middleware/redirect"),
|
|
94
95
|
middleware: true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineEventHandler, sendRedirect, setHeader } from "h3";
|
|
2
|
+
import { joinURL } from "ufo";
|
|
3
|
+
import { useNitroOrigin, useSiteConfig } from "#imports";
|
|
4
|
+
export default defineEventHandler((e) => {
|
|
5
|
+
const siteConfig = useSiteConfig(e);
|
|
6
|
+
if (siteConfig.url) {
|
|
7
|
+
const siteConfigHostName = new URL(e.path, siteConfig.url).hostname;
|
|
8
|
+
const origin = useNitroOrigin(e);
|
|
9
|
+
const originHostname = new URL(e.path, origin).hostname;
|
|
10
|
+
if (e.headers.get("x-nuxt-seo-redirected")) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (originHostname !== siteConfigHostName && originHostname !== new URL(e.path, origin).hostname) {
|
|
14
|
+
setHeader(e, "x-nuxt-seo-redirected", "true");
|
|
15
|
+
return sendRedirect(e, joinURL(siteConfig.url, e.path), 301);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -5,6 +5,6 @@ export declare function useI18n(): {
|
|
|
5
5
|
t: (_: string, fallback: string) => string;
|
|
6
6
|
te: (_: string) => boolean;
|
|
7
7
|
strategy: string;
|
|
8
|
-
defaultLocale: import("
|
|
9
|
-
locale: import("
|
|
8
|
+
defaultLocale: import("#imports").Ref<any>;
|
|
9
|
+
locale: import("#imports").Ref<any>;
|
|
10
10
|
};
|
|
@@ -82,5 +82,5 @@ export interface BreadcrumbItemProps extends NuxtUIBreadcrumbItem {
|
|
|
82
82
|
last: boolean;
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
export declare function useBreadcrumbItems(options?: BreadcrumbProps):
|
|
85
|
+
export declare function useBreadcrumbItems(options?: BreadcrumbProps): import("#imports").ComputedRef<BreadcrumbItemProps[]>;
|
|
86
86
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withoutTrailingSlash } from "ufo";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { pathBreadcrumbSegments } from "../../pure/breadcrumbs.
|
|
3
|
+
import { pathBreadcrumbSegments } from "../../pure/breadcrumbs.js";
|
|
4
4
|
import {
|
|
5
5
|
computed,
|
|
6
6
|
createSitePathResolver,
|
|
@@ -82,7 +82,7 @@ export function useBreadcrumbItems(options = {}) {
|
|
|
82
82
|
}).filter(Boolean);
|
|
83
83
|
});
|
|
84
84
|
const schemaOrgEnabled = typeof options.schemaOrg === "undefined" ? true : options.schemaOrg;
|
|
85
|
-
if (
|
|
85
|
+
if (import.meta.server && schemaOrgEnabled) {
|
|
86
86
|
useSchemaOrg([
|
|
87
87
|
defineBreadcrumb(computed(() => {
|
|
88
88
|
return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module.js'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare module '@nuxt/schema' {
|
|
6
|
-
interface NuxtConfig { ['seo']?: Partial<ModuleOptions> }
|
|
7
|
-
interface NuxtOptions { ['seo']?: ModuleOptions }
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module 'nuxt/schema' {
|
|
11
|
-
interface NuxtConfig { ['seo']?: Partial<ModuleOptions> }
|
|
12
|
-
interface NuxtOptions { ['seo']?: ModuleOptions }
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type { ModuleOptions, default } from './module.js'
|
|
1
|
+
export { type ModuleOptions, default } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare module '@nuxt/schema' {
|
|
6
|
-
interface NuxtConfig { ['seo']?: Partial<ModuleOptions> }
|
|
7
|
-
interface NuxtOptions { ['seo']?: ModuleOptions }
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module 'nuxt/schema' {
|
|
11
|
-
interface NuxtConfig { ['seo']?: Partial<ModuleOptions> }
|
|
12
|
-
interface NuxtOptions { ['seo']?: ModuleOptions }
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type { ModuleOptions, default } from './module'
|
|
1
|
+
export { type ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/seo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
5
|
-
"packageManager": "pnpm@8.15.5",
|
|
4
|
+
"version": "2.0.0-rc.12",
|
|
6
5
|
"description": "The all-in-one SEO layer for Nuxt 3.",
|
|
7
6
|
"author": {
|
|
8
7
|
"name": "Harlan Wilton",
|
|
@@ -32,34 +31,34 @@
|
|
|
32
31
|
"dist"
|
|
33
32
|
],
|
|
34
33
|
"dependencies": {
|
|
35
|
-
"@nuxt/kit": "^3.
|
|
36
|
-
"@nuxtjs/sitemap": "^5.
|
|
34
|
+
"@nuxt/kit": "^3.12.3",
|
|
35
|
+
"@nuxtjs/sitemap": "^5.3.2",
|
|
37
36
|
"defu": "^6.1.4",
|
|
38
|
-
"nuxt-link-checker": "^3.0.0-rc.
|
|
39
|
-
"nuxt-og-image": "^3.0.0-rc.
|
|
40
|
-
"nuxt-schema-org": "^3.3.
|
|
41
|
-
"nuxt-seo-experiments": "4.0.0-rc.
|
|
42
|
-
"nuxt-simple-robots": "4.0.0-rc.
|
|
43
|
-
"nuxt-site-config": "^2.2.
|
|
44
|
-
"nuxt-site-config-kit": "^2.2.
|
|
45
|
-
"pkg-types": "^1.
|
|
37
|
+
"nuxt-link-checker": "^3.0.0-rc.12",
|
|
38
|
+
"nuxt-og-image": "^3.0.0-rc.59",
|
|
39
|
+
"nuxt-schema-org": "^3.3.8",
|
|
40
|
+
"nuxt-seo-experiments": "^4.0.0-rc.10",
|
|
41
|
+
"nuxt-simple-robots": "^4.0.0-rc.20",
|
|
42
|
+
"nuxt-site-config": "^2.2.14",
|
|
43
|
+
"nuxt-site-config-kit": "^2.2.14",
|
|
44
|
+
"pkg-types": "^1.1.3",
|
|
46
45
|
"ufo": "^1.5.3"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@antfu/eslint-config": "^2.
|
|
50
|
-
"@nuxt/
|
|
51
|
-
"@nuxt/
|
|
52
|
-
"@nuxt/
|
|
53
|
-
"@nuxt/
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"nuxt
|
|
61
|
-
"typescript": "
|
|
62
|
-
"vitest": "^
|
|
48
|
+
"@antfu/eslint-config": "^2.22.0",
|
|
49
|
+
"@nuxt/icon": "^1.0.0",
|
|
50
|
+
"@nuxt/module-builder": "^0.8.1",
|
|
51
|
+
"@nuxt/schema": "^3.12.3",
|
|
52
|
+
"@nuxt/test-utils": "3.13.1",
|
|
53
|
+
"@nuxt/ui": "^2.17.0",
|
|
54
|
+
"@nuxtjs/i18n": "^8.3.1",
|
|
55
|
+
"bumpp": "^9.4.1",
|
|
56
|
+
"eslint": "^9.6.0",
|
|
57
|
+
"execa": "^9.3.0",
|
|
58
|
+
"nitropack": "^2.9.7",
|
|
59
|
+
"nuxt": "^3.12.3",
|
|
60
|
+
"typescript": "5.4.5",
|
|
61
|
+
"vitest": "^2.0.2"
|
|
63
62
|
},
|
|
64
63
|
"build": {
|
|
65
64
|
"externals": [
|
|
@@ -70,6 +69,7 @@
|
|
|
70
69
|
"scripts": {
|
|
71
70
|
"build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build",
|
|
72
71
|
"dev": "nuxi dev .playground",
|
|
72
|
+
"dev:docs": "nuxi dev docs",
|
|
73
73
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare .playground",
|
|
74
74
|
"lint": "eslint . --fix",
|
|
75
75
|
"release": "pnpm build && bumpp && pnpm -r publish --access public",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler, sendRedirect } from "h3";
|
|
2
|
-
import { joinURL } from "ufo";
|
|
3
|
-
import { useNitroOrigin, useSiteConfig } from "#imports";
|
|
4
|
-
export default defineEventHandler((e) => {
|
|
5
|
-
const siteConfig = useSiteConfig(e);
|
|
6
|
-
if (siteConfig.site) {
|
|
7
|
-
const siteConfigHostName = new URL(e.path, siteConfig.site).hostname;
|
|
8
|
-
const origin = useNitroOrigin(e);
|
|
9
|
-
const originHostname = new URL(e.path, origin).hostname;
|
|
10
|
-
if (originHostname !== siteConfigHostName)
|
|
11
|
-
return sendRedirect(e, joinURL(siteConfig.site, e.path), 301);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|