nuxt-schema-org 5.0.7 → 5.0.9
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/client/200.html +1 -0
- package/dist/client/404.html +1 -0
- package/dist/client/_nuxt/3mPCgC9T.js +1 -0
- package/dist/client/_nuxt/B3Z8rEby.js +1 -0
- package/dist/client/_nuxt/BMMyXqK5.js +1 -0
- package/dist/client/_nuxt/BpdejJ-Z.js +174 -0
- package/dist/client/_nuxt/CVO1_9PV.js +1 -0
- package/dist/client/_nuxt/Cp-IABpG.js +1 -0
- package/dist/client/_nuxt/D0r3Knsf.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -0
- package/dist/client/_nuxt/builds/meta/8a772054-fdc3-4341-9461-52f13effa2ab.json +1 -0
- package/dist/client/_nuxt/entry.BVcYdedQ.css +1 -0
- package/dist/client/_nuxt/error-404.C93bBBKL.css +1 -0
- package/dist/client/_nuxt/error-500.zofSQbXz.css +1 -0
- package/dist/client/index.html +1 -0
- package/dist/content.cjs +28 -0
- package/dist/content.d.cts +14 -0
- package/dist/content.d.mts +14 -0
- package/dist/content.d.ts +14 -0
- package/dist/content.mjs +24 -0
- package/dist/module.cjs +221 -0
- package/dist/module.d.cts +50 -0
- package/dist/module.d.mts +50 -0
- package/dist/module.d.ts +50 -0
- package/dist/module.json +29 -0
- package/dist/module.mjs +218 -0
- package/dist/runtime/app/composables/useSchemaOrg.d.ts +4 -0
- package/dist/runtime/app/composables/useSchemaOrg.js +27 -0
- package/dist/runtime/app/plugins/defaults.d.ts +2 -0
- package/dist/runtime/app/plugins/defaults.js +28 -0
- package/dist/runtime/app/plugins/i18n/defaults.d.ts +2 -0
- package/dist/runtime/app/plugins/i18n/defaults.js +77 -0
- package/dist/runtime/app/plugins/i18n/init.d.ts +2 -0
- package/dist/runtime/app/plugins/i18n/init.js +11 -0
- package/dist/runtime/app/plugins/i18n/tsconfig.json +3 -0
- package/dist/runtime/app/plugins/init.d.ts +2 -0
- package/dist/runtime/app/plugins/init.js +8 -0
- package/dist/runtime/app/utils/config.d.ts +2 -0
- package/dist/runtime/app/utils/config.js +8 -0
- package/dist/runtime/app/utils/shared.d.ts +3 -0
- package/dist/runtime/app/utils/shared.js +99 -0
- package/dist/runtime/server/plugins/nuxt-content-v2.d.ts +2 -0
- package/dist/runtime/server/plugins/nuxt-content-v2.js +37 -0
- package/dist/runtime/server/routes/__schema-org__/debug.d.ts +5 -0
- package/dist/runtime/server/routes/__schema-org__/debug.js +10 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/config.d.ts +3 -0
- package/dist/runtime/server/utils/config.js +8 -0
- package/dist/runtime/types.d.ts +9 -0
- package/dist/runtime/types.js +0 -0
- package/dist/schema.cjs +16 -0
- package/dist/schema.d.cts +1 -0
- package/dist/schema.d.mts +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.mjs +1 -0
- package/dist/types.d.mts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineWebPage } from "@unhead/schema-org/vue";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { defineNitroPlugin } from "nitropack/runtime";
|
|
4
|
+
import { useSchemaOrgConfig } from "../utils/config.js";
|
|
5
|
+
export default defineNitroPlugin((nitroApp) => {
|
|
6
|
+
const config = useSchemaOrgConfig();
|
|
7
|
+
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
8
|
+
if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
|
|
9
|
+
return;
|
|
10
|
+
if (!content.schemaOrg) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const nodes = Array.isArray(content.schemaOrg) ? content.schemaOrg : [defineWebPage(content.schemaOrg)];
|
|
14
|
+
const replaceType = (node) => {
|
|
15
|
+
if (node.type) {
|
|
16
|
+
node["@type"] = node.type;
|
|
17
|
+
delete node.type;
|
|
18
|
+
}
|
|
19
|
+
Object.entries(node).forEach(([, value]) => {
|
|
20
|
+
if (typeof value === "object") {
|
|
21
|
+
replaceType(value);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return node;
|
|
25
|
+
};
|
|
26
|
+
const script = {
|
|
27
|
+
type: "application/ld+json",
|
|
28
|
+
key: "schema-org-graph",
|
|
29
|
+
nodes: nodes.map(replaceType),
|
|
30
|
+
...config.scriptAttributes
|
|
31
|
+
};
|
|
32
|
+
content.head = defu({
|
|
33
|
+
script: [script]
|
|
34
|
+
}, content.head);
|
|
35
|
+
return content;
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useNitroOrigin } from "#site-config/server/composables/useNitroOrigin";
|
|
2
|
+
import { defineEventHandler } from "h3";
|
|
3
|
+
import { useSchemaOrgConfig } from "../../utils/config.js";
|
|
4
|
+
export default defineEventHandler(async (e) => {
|
|
5
|
+
const nitroOrigin = useNitroOrigin(e);
|
|
6
|
+
return {
|
|
7
|
+
nitroOrigin,
|
|
8
|
+
runtimeConfig: useSchemaOrgConfig(e)
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defu } from "defu";
|
|
2
|
+
import { useRuntimeConfig } from "nitropack/runtime";
|
|
3
|
+
export function useSchemaOrgConfig(e) {
|
|
4
|
+
const runtimeConfig = useRuntimeConfig(e);
|
|
5
|
+
return defu(import.meta.client ? runtimeConfig.public["nuxt-schema-org"] : runtimeConfig["nuxt-schema-org"], {
|
|
6
|
+
scriptAttributes: {}
|
|
7
|
+
});
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModuleOptions } from '../module.js';
|
|
2
|
+
export type ModuleRuntimeConfig = Pick<ModuleOptions, 'scriptAttributes' | 'reactive' | 'minify' | 'identity'> & {
|
|
3
|
+
version: string;
|
|
4
|
+
};
|
|
5
|
+
export interface UnheadAugmentation<T> {
|
|
6
|
+
script: {
|
|
7
|
+
nodes: T;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
File without changes
|
package/dist/schema.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const schemaOrg = require('@unhead/schema-org');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.prototype.hasOwnProperty.call(schemaOrg, '__proto__') &&
|
|
8
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
9
|
+
Object.defineProperty(exports, '__proto__', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
value: schemaOrg['__proto__']
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
Object.keys(schemaOrg).forEach(function (k) {
|
|
15
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemaOrg[k];
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unhead/schema-org';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unhead/schema-org';
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unhead/schema-org';
|
package/dist/schema.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@unhead/schema-org';
|
package/dist/types.d.mts
ADDED
package/package.json
CHANGED