nuxt-schema-org 3.0.0-beta.1 → 3.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.
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.mjs +26 -22
- package/package.json +12 -12
package/dist/module.json
CHANGED
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { PluginSchemaOrg } from "@unhead/schema-org";
|
|
2
2
|
import { defineNuxtPlugin, injectHead, unref, useRouter, useRuntimeConfig, useSiteConfig } from "#imports";
|
|
3
|
-
export default defineNuxtPlugin(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
export default defineNuxtPlugin({
|
|
4
|
+
name: "nuxt-schema-org:init",
|
|
5
|
+
enforce: "post",
|
|
6
|
+
setup(nuxtApp) {
|
|
7
|
+
const head = injectHead();
|
|
8
|
+
const config = useRuntimeConfig().public["nuxt-schema-org"];
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const currentRoute = router.currentRoute;
|
|
11
|
+
const siteConfig = useSiteConfig();
|
|
12
|
+
head.use(PluginSchemaOrg({
|
|
13
|
+
minify: config.minify,
|
|
14
|
+
resolveMeta: async () => {
|
|
15
|
+
const route = unref(currentRoute);
|
|
16
|
+
const meta = {
|
|
17
|
+
host: siteConfig.url,
|
|
18
|
+
trailingSlash: siteConfig.trailingSlash,
|
|
19
|
+
inLanguage: siteConfig.currentLocale || siteConfig.defaultLocale,
|
|
20
|
+
...siteConfig,
|
|
21
|
+
...route.meta,
|
|
22
|
+
path: route.path
|
|
23
|
+
};
|
|
24
|
+
await nuxtApp.hooks.callHook("schema-org:meta", meta);
|
|
25
|
+
return meta;
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
25
29
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-schema-org",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0
|
|
5
|
-
"packageManager": "pnpm@8.7.
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"packageManager": "pnpm@8.7.5",
|
|
6
6
|
"description": "Schema.org for Nuxt",
|
|
7
7
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@nuxt/kit": "^3.7.
|
|
39
|
-
"@unhead/schema-org": "^1.
|
|
40
|
-
"nuxt-site-config": "^1.
|
|
41
|
-
"nuxt-site-config-kit": "^1.
|
|
38
|
+
"@nuxt/kit": "^3.7.3",
|
|
39
|
+
"@unhead/schema-org": "^1.7.3",
|
|
40
|
+
"nuxt-site-config": "^1.2.1",
|
|
41
|
+
"nuxt-site-config-kit": "^1.2.1",
|
|
42
42
|
"pathe": "^1.1.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^0.
|
|
45
|
+
"@antfu/eslint-config": "^0.42.0",
|
|
46
46
|
"@nuxt/module-builder": "^0.5.1",
|
|
47
|
-
"@nuxt/schema": "^3.7.
|
|
48
|
-
"@nuxt/test-utils": "^3.7.
|
|
47
|
+
"@nuxt/schema": "^3.7.3",
|
|
48
|
+
"@nuxt/test-utils": "^3.7.3",
|
|
49
49
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
50
50
|
"bumpp": "^9.2.0",
|
|
51
|
-
"eslint": "8.
|
|
52
|
-
"nuxt": "^3.7.
|
|
51
|
+
"eslint": "8.49.0",
|
|
52
|
+
"nuxt": "^3.7.3",
|
|
53
53
|
"nuxt-windicss": "^2.6.1",
|
|
54
|
-
"vitest": "0.34.
|
|
54
|
+
"vitest": "0.34.4"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"lint": "eslint . --fix",
|