@nuxtjs/seo 2.0.0-rc.3 → 2.0.0-rc.5
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
CHANGED
|
@@ -17,7 +17,7 @@ The complete SEO solution for Nuxt.
|
|
|
17
17
|
<tbody>
|
|
18
18
|
<td align="center">
|
|
19
19
|
<img width="800" height="0" /><br>
|
|
20
|
-
<i>Status:</i> <a href="https://github.com/harlan-zw/nuxt-seo/releases/tag/v2.0.0">v2
|
|
20
|
+
<i>Status:</i> <a href="https://github.com/harlan-zw/nuxt-seo/releases/tag/v2.0.0">v2 RC is available</a></b> <br>
|
|
21
21
|
<sup> Please report any issues 🐛</sup><br>
|
|
22
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
23
|
<img width="800" height="0" />
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { defineNuxtModule,
|
|
1
|
+
import { defineNuxtModule, createResolver, useLogger, installModule, addPlugin, hasNuxtModule, addImports, addServerHandler } from '@nuxt/kit';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
4
|
-
|
|
5
|
-
const version = "2.0.0-rc.2";
|
|
3
|
+
import { installNuxtSiteConfig, useSiteConfig } from 'nuxt-site-config-kit';
|
|
4
|
+
import { readPackageJSON } from 'pkg-types';
|
|
6
5
|
|
|
7
6
|
const Modules = [
|
|
8
7
|
"nuxt-simple-robots",
|
|
@@ -32,13 +31,14 @@ const module = defineNuxtModule({
|
|
|
32
31
|
};
|
|
33
32
|
},
|
|
34
33
|
async setup(config, nuxt) {
|
|
35
|
-
const
|
|
34
|
+
const { resolve, resolvePath } = createResolver(import.meta.url);
|
|
35
|
+
const { name, version } = await readPackageJSON(resolve("../package.json"));
|
|
36
|
+
const logger = useLogger(name);
|
|
36
37
|
logger.level = config.debug ? 4 : 3;
|
|
37
38
|
if (config.enabled === false) {
|
|
38
39
|
logger.debug("The module is disabled, skipping setup.");
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
const { resolve, resolvePath } = createResolver(import.meta.url);
|
|
42
42
|
await installNuxtSiteConfig();
|
|
43
43
|
for (const module of Modules)
|
|
44
44
|
await installModule(await resolvePath(module));
|
|
@@ -62,15 +62,18 @@ const module = defineNuxtModule({
|
|
|
62
62
|
from: resolve(`./runtime/nuxt/composables/useBreadcrumbItems`),
|
|
63
63
|
name: "useBreadcrumbItems"
|
|
64
64
|
});
|
|
65
|
+
const siteConfig = useSiteConfig();
|
|
66
|
+
if (nuxt.options.experimental?.defaults?.nuxtLink && typeof nuxt.options.experimental?.defaults?.nuxtLink?.trailingSlash == "undefined")
|
|
67
|
+
nuxt.options.experimental.defaults.nuxtLink.trailingSlash = siteConfig.trailingSlash ? "append" : "remove";
|
|
65
68
|
const polyfills = {
|
|
66
69
|
schemaOrg: ["useSchemaOrg", "defineWebSite", "defineWebPage"]
|
|
67
70
|
};
|
|
68
71
|
for (const [module, composables] of Object.entries(polyfills)) {
|
|
69
72
|
if (nuxt.options[module]?.enable === false) {
|
|
70
|
-
composables.forEach((
|
|
73
|
+
composables.forEach((name2) => {
|
|
71
74
|
addImports({
|
|
72
75
|
from: resolve("./runtime/nuxt/composables/polyfills"),
|
|
73
|
-
name
|
|
76
|
+
name: name2
|
|
74
77
|
});
|
|
75
78
|
});
|
|
76
79
|
}
|
|
@@ -4,11 +4,10 @@ import { useNitroOrigin, useSiteConfig } from "#imports";
|
|
|
4
4
|
export default defineEventHandler((e) => {
|
|
5
5
|
const siteConfig = useSiteConfig(e);
|
|
6
6
|
if (siteConfig.site) {
|
|
7
|
+
const siteConfigHostName = new URL(e.path, siteConfig.site).hostname;
|
|
7
8
|
const origin = useNitroOrigin(e);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return sendRedirect(e, joinURL(siteConfig.site, url.pathname), 301);
|
|
12
|
-
}
|
|
9
|
+
const originHostname = new URL(e.path, origin).hostname;
|
|
10
|
+
if (originHostname !== siteConfigHostName)
|
|
11
|
+
return sendRedirect(e, joinURL(siteConfig.site, e.path), 301);
|
|
13
12
|
}
|
|
14
13
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/seo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
5
|
-
"packageManager": "pnpm@8.14.
|
|
4
|
+
"version": "2.0.0-rc.5",
|
|
5
|
+
"packageManager": "pnpm@8.14.1",
|
|
6
6
|
"description": "The all-in-one SEO layer for Nuxt 3.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Harlan Wilton",
|
|
@@ -33,24 +33,25 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@nuxt/kit": "^3.9.1",
|
|
36
|
-
"@nuxtjs/sitemap": "^5.0.
|
|
36
|
+
"@nuxtjs/sitemap": "^5.0.4",
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
38
|
"defu": "^6.1.4",
|
|
39
39
|
"nuxt-link-checker": "^3.0.0-rc.4",
|
|
40
|
-
"nuxt-og-image": "3.0.0-rc.
|
|
41
|
-
"nuxt-schema-org": "^3.3.
|
|
40
|
+
"nuxt-og-image": "^3.0.0-rc.27",
|
|
41
|
+
"nuxt-schema-org": "^3.3.3",
|
|
42
42
|
"nuxt-seo-experiments": "^4.0.0-rc.0",
|
|
43
|
-
"nuxt-simple-robots": "^4.0.0-rc.
|
|
44
|
-
"nuxt-site-config": "^2.2.
|
|
45
|
-
"nuxt-site-config-kit": "^2.2.
|
|
43
|
+
"nuxt-simple-robots": "^4.0.0-rc.11",
|
|
44
|
+
"nuxt-site-config": "^2.2.5",
|
|
45
|
+
"nuxt-site-config-kit": "^2.2.5",
|
|
46
|
+
"pkg-types": "^1.0.3",
|
|
46
47
|
"ufo": "^1.3.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@antfu/eslint-config": "^2.6.
|
|
50
|
+
"@antfu/eslint-config": "^2.6.2",
|
|
50
51
|
"@nuxt/module-builder": "^0.5.5",
|
|
51
52
|
"@nuxt/schema": "^3.9.1",
|
|
52
53
|
"@nuxt/test-utils": "3.9.0",
|
|
53
|
-
"@nuxt/ui": "^2.
|
|
54
|
+
"@nuxt/ui": "^2.12.0",
|
|
54
55
|
"@nuxtjs/i18n": "8.0.0",
|
|
55
56
|
"bumpp": "^9.2.1",
|
|
56
57
|
"eslint": "^8.56.0",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"nuxt": "^3.9.1",
|
|
60
61
|
"nuxt-icon": "^0.6.8",
|
|
61
62
|
"typescript": "^5.3.3",
|
|
62
|
-
"vitest": "^1.
|
|
63
|
+
"vitest": "^1.2.0"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
65
66
|
"build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build",
|