nuxt-schema-org 5.0.2 → 5.0.4
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 +9 -9
- package/README.md +71 -71
- package/content.d.ts +1 -1
- package/dist/client/200.html +10 -10
- package/dist/client/404.html +10 -10
- package/dist/client/_nuxt/BLmTiKMJ.js +1 -0
- package/dist/client/_nuxt/{DwBWYBek.js → DDeFBXf-.js} +1 -1
- package/dist/client/_nuxt/DFxyEsuO.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c293d80d-b49c-492c-9886-92621e6ffa4b.json +1 -0
- package/dist/client/_nuxt/entry.BG11QubP.css +1 -0
- package/dist/client/_nuxt/error-404.Ba0p0jEX.css +1 -0
- package/dist/client/_nuxt/error-500.BuNiDSQ1.css +1 -0
- package/dist/client/_nuxt/inuEOpo5.js +174 -0
- package/dist/client/_nuxt/{DkaL0WGB.js → l5BvQyJI.js} +1 -1
- package/dist/client/index.html +10 -10
- package/dist/module.cjs +2 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -5
- package/dist/runtime/app/composables/useSchemaOrg.d.ts +1 -1
- package/dist/runtime/app/plugins/defaults.js +9 -4
- package/dist/runtime/app/plugins/i18n/defaults.js +16 -12
- package/dist/runtime/app/plugins/i18n/init.js +1 -0
- package/dist/runtime/app/plugins/i18n/tsconfig.json +3 -3
- package/dist/runtime/app/utils/shared.js +35 -14
- package/dist/runtime/server/plugins/nuxt-content-v2.js +1 -1
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +15 -14
- package/schema.d.ts +1 -1
- package/dist/client/_nuxt/BFRWAddy.js +0 -171
- package/dist/client/_nuxt/DTAJTTim.js +0 -1
- package/dist/client/_nuxt/builds/meta/c5192944-6b14-45f4-9ec3-5b88a0f161d3.json +0 -1
- package/dist/client/_nuxt/entry.ebO64jLo.css +0 -1
- package/dist/client/_nuxt/error-404.xH3Cf7mp.css +0 -1
- package/dist/client/_nuxt/error-500.D1eGBBaO.css +0 -1
- package/dist/client/_nuxt/ySlJ1b_l.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s,u as a,c as i,o as u,a as e,t as o}from"./
|
|
1
|
+
import{_ as s,u as a,c as i,o as u,a as e,t as o}from"./inuEOpo5.js";const l={class:"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"},c={class:"max-w-520px text-center"},d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const r=t;return a({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{children:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{children:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,n)=>(u(),i("div",l,[n[0]||(n[0]=e("div",{class:"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"},null,-1)),e("div",c,[e("h1",{class:"font-medium mb-8 sm:text-10xl text-8xl",textContent:o(t.statusCode)},null,8,d),e("p",{class:"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl",textContent:o(t.description)},null,8,p)])]))}},b=s(f,[["__scopeId","data-v-3b00d87b"]]);export{b as default};
|
package/dist/client/index.html
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__nuxt-schema-org/_nuxt/entry.
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/
|
|
3
|
+
<link rel="stylesheet" href="/__nuxt-schema-org/_nuxt/entry.BG11QubP.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/inuEOpo5.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/CVO1_9PV.js">
|
|
6
6
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/D0r3Knsf.js">
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/
|
|
9
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-schema-org/_nuxt/error-404.
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/
|
|
11
|
-
<link rel="prefetch" as="style" crossorigin href="/__nuxt-schema-org/_nuxt/error-500.
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/
|
|
13
|
-
<script type="module" src="/__nuxt-schema-org/_nuxt/
|
|
14
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-schema-org",buildId:"
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/DFxyEsuO.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/BLmTiKMJ.js">
|
|
9
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-schema-org/_nuxt/error-404.Ba0p0jEX.css">
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/DDeFBXf-.js">
|
|
11
|
+
<link rel="prefetch" as="style" crossorigin href="/__nuxt-schema-org/_nuxt/error-500.BuNiDSQ1.css">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-schema-org/_nuxt/l5BvQyJI.js">
|
|
13
|
+
<script type="module" src="/__nuxt-schema-org/_nuxt/inuEOpo5.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"nuxt-schema-org-devtools"}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1741895403324,false]</script>
|
|
14
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-schema-org",buildId:"c293d80d-b49c-492c-9886-92621e6ffa4b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.cjs
CHANGED
|
@@ -112,8 +112,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
112
112
|
};
|
|
113
113
|
if (config.reactive)
|
|
114
114
|
nuxt.options.runtimeConfig.public["nuxt-schema-org"] = runtimeConfig;
|
|
115
|
-
|
|
116
|
-
nuxt.options.runtimeConfig["nuxt-schema-org"] = runtimeConfig;
|
|
115
|
+
nuxt.options.runtimeConfig["nuxt-schema-org"] = runtimeConfig;
|
|
117
116
|
const pluginPath = kit.hasNuxtModule("@nuxtjs/i18n") && nuxt.options.i18n?.locales ? "./runtime/app/plugins/i18n" : "./runtime/app/plugins";
|
|
118
117
|
kit.addPlugin({
|
|
119
118
|
src: resolve(pluginPath, "init"),
|
|
@@ -154,9 +153,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
154
153
|
...config.scriptAttributes,
|
|
155
154
|
nodes: nodes.map(replaceType)
|
|
156
155
|
};
|
|
157
|
-
content.head = defu.defu({
|
|
158
|
-
script: [script]
|
|
159
|
-
}, content.head);
|
|
156
|
+
content.head = defu.defu({ script: [script] }, content.head);
|
|
160
157
|
ctx.content = content;
|
|
161
158
|
});
|
|
162
159
|
} else if (isNuxtContentV2) {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -109,8 +109,7 @@ const module = defineNuxtModule({
|
|
|
109
109
|
};
|
|
110
110
|
if (config.reactive)
|
|
111
111
|
nuxt.options.runtimeConfig.public["nuxt-schema-org"] = runtimeConfig;
|
|
112
|
-
|
|
113
|
-
nuxt.options.runtimeConfig["nuxt-schema-org"] = runtimeConfig;
|
|
112
|
+
nuxt.options.runtimeConfig["nuxt-schema-org"] = runtimeConfig;
|
|
114
113
|
const pluginPath = hasNuxtModule("@nuxtjs/i18n") && nuxt.options.i18n?.locales ? "./runtime/app/plugins/i18n" : "./runtime/app/plugins";
|
|
115
114
|
addPlugin({
|
|
116
115
|
src: resolve(pluginPath, "init"),
|
|
@@ -151,9 +150,7 @@ const module = defineNuxtModule({
|
|
|
151
150
|
...config.scriptAttributes,
|
|
152
151
|
nodes: nodes.map(replaceType)
|
|
153
152
|
};
|
|
154
|
-
content.head = defu({
|
|
155
|
-
script: [script]
|
|
156
|
-
}, content.head);
|
|
153
|
+
content.head = defu({ script: [script] }, content.head);
|
|
157
154
|
ctx.content = content;
|
|
158
155
|
});
|
|
159
156
|
} else if (isNuxtContentV2) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { useSchemaOrg as _useSchemaOrg } from '@unhead/schema-org/vue';
|
|
2
2
|
type Input = Parameters<typeof _useSchemaOrg>[0];
|
|
3
|
-
export declare function useSchemaOrg<T extends Input>(input: T): void | import("
|
|
3
|
+
export declare function useSchemaOrg<T extends Input>(input: T): void | import("unhead/types").ActiveHeadEntry<import("@unhead/vue").UseHeadInput<Deprecated>>;
|
|
4
4
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useSiteConfig } from "#site-config/app/composables/useSiteConfig";
|
|
2
2
|
import { defineWebPage, defineWebSite } from "@unhead/schema-org/vue";
|
|
3
|
-
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
|
+
import { defineNuxtPlugin, useError } from "nuxt/app";
|
|
4
|
+
import { toValue } from "vue";
|
|
4
5
|
import { useSchemaOrg } from "../composables/useSchemaOrg.js";
|
|
5
6
|
import { maybeAddIdentitySchemaOrg } from "../utils/shared.js";
|
|
6
7
|
export default defineNuxtPlugin({
|
|
@@ -9,12 +10,16 @@ export default defineNuxtPlugin({
|
|
|
9
10
|
"nuxt-schema-org:init"
|
|
10
11
|
],
|
|
11
12
|
setup() {
|
|
13
|
+
const error = useError();
|
|
14
|
+
if (error.value?.error) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
const siteConfig = useSiteConfig();
|
|
13
18
|
useSchemaOrg([
|
|
14
19
|
defineWebSite({
|
|
15
|
-
name: siteConfig
|
|
16
|
-
inLanguage: siteConfig
|
|
17
|
-
description: siteConfig
|
|
20
|
+
name: () => toValue(siteConfig.name) || "",
|
|
21
|
+
inLanguage: () => toValue(siteConfig.currentLocale) || "",
|
|
22
|
+
description: () => toValue(siteConfig.description) || ""
|
|
18
23
|
}),
|
|
19
24
|
defineWebPage()
|
|
20
25
|
]);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useLocalePath } from "#i18n";
|
|
2
|
-
import {
|
|
3
|
-
useSiteConfig
|
|
4
|
-
} from "#site-config/app/composables/useSiteConfig";
|
|
2
|
+
import { useSiteConfig } from "#site-config/app/composables/useSiteConfig";
|
|
5
3
|
import { createSitePathResolver } from "#site-config/app/composables/utils";
|
|
6
4
|
import { defineWebPage, defineWebSite } from "@unhead/schema-org/vue";
|
|
7
5
|
import { resolveSitePath } from "nuxt-site-config/urls";
|
|
8
|
-
import { defineNuxtPlugin, useRuntimeConfig } from "nuxt/app";
|
|
6
|
+
import { defineNuxtPlugin, useError, useRuntimeConfig } from "nuxt/app";
|
|
9
7
|
import { hasProtocol, withHttps } from "ufo";
|
|
8
|
+
import { toValue } from "vue";
|
|
10
9
|
import { useSchemaOrg } from "../../composables/useSchemaOrg.js";
|
|
11
10
|
import { maybeAddIdentitySchemaOrg } from "../../utils/shared.js";
|
|
12
11
|
export default defineNuxtPlugin({
|
|
@@ -15,6 +14,10 @@ export default defineNuxtPlugin({
|
|
|
15
14
|
"nuxt-schema-org:init"
|
|
16
15
|
],
|
|
17
16
|
setup(nuxtApp) {
|
|
17
|
+
const error = useError();
|
|
18
|
+
if (error.value?.error) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
18
21
|
const siteConfig = useSiteConfig();
|
|
19
22
|
const pathResolver = createSitePathResolver({
|
|
20
23
|
canonical: true,
|
|
@@ -24,14 +27,15 @@ export default defineNuxtPlugin({
|
|
|
24
27
|
return;
|
|
25
28
|
const localePath = useLocalePath();
|
|
26
29
|
const locales = nuxtApp.$i18n?.locales.value || [];
|
|
27
|
-
const siteUrl = pathResolver(localePath("index")).value;
|
|
28
|
-
const websiteId = `${siteUrl}#website`;
|
|
30
|
+
const siteUrl = () => pathResolver(localePath("index")).value;
|
|
31
|
+
const websiteId = () => `${siteUrl()}#website`;
|
|
29
32
|
const website = defineWebSite({
|
|
30
33
|
"@id": websiteId,
|
|
31
34
|
"url": siteUrl,
|
|
32
|
-
"name": siteConfig
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
+
"name": () => toValue(siteConfig.name) || "",
|
|
36
|
+
// @ts-expect-error untyped
|
|
37
|
+
"inLanguage": () => toValue(nuxtApp.$i18n.localeProperties.value.language) || "",
|
|
38
|
+
"description": () => toValue(siteConfig.description) || ""
|
|
35
39
|
});
|
|
36
40
|
const nuxtBase = useRuntimeConfig().app.baseURL || "/";
|
|
37
41
|
const resolveIdForLocale = (locale) => {
|
|
@@ -49,13 +53,13 @@ export default defineNuxtPlugin({
|
|
|
49
53
|
if (siteConfig.currentLocale && siteConfig.currentLocale !== siteConfig.defaultLocale) {
|
|
50
54
|
website.translationOfWork = {
|
|
51
55
|
"@type": "WebSite",
|
|
52
|
-
"@id": `${resolveIdForLocale({ code: siteConfig.defaultLocale })}#website`
|
|
56
|
+
"@id": () => `${resolveIdForLocale({ code: toValue(siteConfig.defaultLocale) })}#website`
|
|
53
57
|
};
|
|
54
58
|
} else {
|
|
55
59
|
website.workTranslation = locales.filter((locale) => locale.code !== siteConfig.defaultLocale).map((locale) => {
|
|
56
60
|
return {
|
|
57
61
|
"@type": "WebSite",
|
|
58
|
-
"@id": `${resolveIdForLocale(locale)}#website`
|
|
62
|
+
"@id": () => `${resolveIdForLocale(locale)}#website`
|
|
59
63
|
};
|
|
60
64
|
});
|
|
61
65
|
}
|
|
@@ -64,7 +68,7 @@ export default defineNuxtPlugin({
|
|
|
64
68
|
website,
|
|
65
69
|
defineWebPage({
|
|
66
70
|
isPartOf: {
|
|
67
|
-
"@id": websiteId
|
|
71
|
+
"@id": websiteId()
|
|
68
72
|
}
|
|
69
73
|
})
|
|
70
74
|
]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../../test/fixtures/i18n/.nuxt/tsconfig.json"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../../test/fixtures/i18n/.nuxt/tsconfig.json"
|
|
3
|
+
}
|
|
@@ -4,13 +4,12 @@ import {
|
|
|
4
4
|
} from "#site-config/app/composables/useSiteConfig";
|
|
5
5
|
import { createSitePathResolver } from "#site-config/app/composables/utils";
|
|
6
6
|
import { SchemaOrgUnheadPlugin } from "@unhead/schema-org/vue";
|
|
7
|
-
import { defu } from "defu";
|
|
8
7
|
import { useRoute } from "nuxt/app";
|
|
9
8
|
import { camelCase } from "scule";
|
|
10
|
-
import {
|
|
9
|
+
import { withTrailingSlash } from "ufo";
|
|
10
|
+
import { computed, toValue, watch } from "vue";
|
|
11
11
|
import { useSchemaOrg } from "../composables/useSchemaOrg.js";
|
|
12
12
|
import { useSchemaOrgConfig } from "./config.js";
|
|
13
|
-
import { withTrailingSlash } from "ufo";
|
|
14
13
|
export function initPlugin(nuxtApp) {
|
|
15
14
|
const head = injectHead();
|
|
16
15
|
const config = useSchemaOrgConfig();
|
|
@@ -26,18 +25,35 @@ export function initPlugin(nuxtApp) {
|
|
|
26
25
|
withBase: true
|
|
27
26
|
});
|
|
28
27
|
const schemaOrg = computed(() => {
|
|
28
|
+
const siteConfigResolved = {};
|
|
29
|
+
for (const key in siteConfig) {
|
|
30
|
+
if (key.startsWith("_")) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
siteConfigResolved[key] = toValue(siteConfig[key]);
|
|
34
|
+
if (typeof siteConfigResolved[key] === "object") {
|
|
35
|
+
for (const k in siteConfigResolved[key]) {
|
|
36
|
+
siteConfigResolved[key][k] = toValue(siteConfigResolved[key][k]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
29
40
|
return {
|
|
30
41
|
...route.meta?.schemaOrg || {},
|
|
31
|
-
...
|
|
32
|
-
url: resolveUrl(route.path),
|
|
33
|
-
host: withTrailingSlash(
|
|
34
|
-
inLanguage: toValue(
|
|
35
|
-
path: resolvePath(route.path)
|
|
42
|
+
...siteConfigResolved,
|
|
43
|
+
url: toValue(resolveUrl(route.path)),
|
|
44
|
+
host: withTrailingSlash(siteConfigResolved.url),
|
|
45
|
+
inLanguage: toValue(siteConfigResolved.currentLocale) || toValue(siteConfigResolved.defaultLocale),
|
|
46
|
+
path: toValue(resolvePath(route.path))
|
|
36
47
|
};
|
|
37
48
|
});
|
|
38
|
-
useHead({
|
|
39
|
-
templateParams: { schemaOrg }
|
|
49
|
+
const templateParamEntry = useHead({
|
|
50
|
+
templateParams: { schemaOrg: schemaOrg.value }
|
|
40
51
|
});
|
|
52
|
+
watch(() => siteConfig, () => {
|
|
53
|
+
templateParamEntry.patch({
|
|
54
|
+
templateParams: { schemaOrg: schemaOrg.value }
|
|
55
|
+
});
|
|
56
|
+
}, { deep: true });
|
|
41
57
|
head.use(
|
|
42
58
|
SchemaOrgUnheadPlugin({}, async () => {
|
|
43
59
|
const meta = {};
|
|
@@ -51,16 +67,21 @@ export function initPlugin(nuxtApp) {
|
|
|
51
67
|
}
|
|
52
68
|
export function maybeAddIdentitySchemaOrg() {
|
|
53
69
|
const config = useSchemaOrgConfig();
|
|
54
|
-
const siteConfig = useSiteConfig(
|
|
70
|
+
const siteConfig = useSiteConfig({
|
|
71
|
+
resolveRefs: true
|
|
72
|
+
});
|
|
55
73
|
if (config.identity || siteConfig.identity) {
|
|
56
74
|
const identity = config.identity || siteConfig.identity;
|
|
57
75
|
let identityPayload = {
|
|
58
|
-
name: siteConfig.name,
|
|
59
|
-
url: siteConfig.url
|
|
76
|
+
name: () => toValue(siteConfig.name),
|
|
77
|
+
url: () => toValue(siteConfig.url)
|
|
60
78
|
};
|
|
61
79
|
let identityType;
|
|
62
80
|
if (typeof identity !== "string") {
|
|
63
|
-
identityPayload =
|
|
81
|
+
identityPayload = {
|
|
82
|
+
...identityPayload,
|
|
83
|
+
...identity
|
|
84
|
+
};
|
|
64
85
|
identityType = identity.type;
|
|
65
86
|
delete identityPayload.type;
|
|
66
87
|
} else {
|
|
@@ -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-schema-org",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.4",
|
|
5
5
|
"description": "The quickest and easiest way to build Schema.org graphs for Nuxt.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
-
"types": "./dist/types.d.
|
|
26
|
+
"types": "./dist/types.d.mts",
|
|
27
27
|
"import": "./dist/module.mjs",
|
|
28
28
|
"require": "./dist/module.cjs"
|
|
29
29
|
},
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"main": "./dist/module.cjs",
|
|
40
|
+
"module": "./dist/module.mjs",
|
|
40
41
|
"types": "./dist/types.d.ts",
|
|
41
42
|
"typesVersions": {
|
|
42
43
|
"*": {
|
|
@@ -53,29 +54,26 @@
|
|
|
53
54
|
"dist",
|
|
54
55
|
"schema.d.ts"
|
|
55
56
|
],
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"@unhead/vue": "^2.0.0-rc.1",
|
|
58
|
-
"nuxt": "^3.16.0"
|
|
59
|
-
},
|
|
60
57
|
"dependencies": {
|
|
61
58
|
"@nuxt/kit": "^3.16.0",
|
|
62
|
-
"@unhead/schema-org": "^2.0.0-rc.
|
|
59
|
+
"@unhead/schema-org": "^2.0.0-rc.13",
|
|
63
60
|
"defu": "^6.1.4",
|
|
64
|
-
"nuxt-site-config": "^3.1.
|
|
61
|
+
"nuxt-site-config": "^3.1.5",
|
|
65
62
|
"pathe": "^2.0.3",
|
|
66
63
|
"pkg-types": "^2.1.0",
|
|
67
64
|
"sirv": "^3.0.1"
|
|
68
65
|
},
|
|
69
66
|
"devDependencies": {
|
|
70
|
-
"@antfu/eslint-config": "^4.
|
|
67
|
+
"@antfu/eslint-config": "^4.10.1",
|
|
68
|
+
"@arethetypeswrong/cli": "0.17.4",
|
|
71
69
|
"@nuxt/content": "^3.3.0",
|
|
72
70
|
"@nuxt/module-builder": "^0.8.4",
|
|
73
71
|
"@nuxt/schema": "^3.16.0",
|
|
74
72
|
"@nuxt/test-utils": "^3.17.2",
|
|
75
|
-
"@nuxt/ui": "^
|
|
73
|
+
"@nuxt/ui": "^3.0.0",
|
|
76
74
|
"@nuxtjs/i18n": "^9.3.1",
|
|
77
|
-
"@nuxtjs/robots": "^5.2.
|
|
78
|
-
"bumpp": "^10.0
|
|
75
|
+
"@nuxtjs/robots": "^5.2.7",
|
|
76
|
+
"bumpp": "^10.1.0",
|
|
79
77
|
"cheerio": "^1.0.0",
|
|
80
78
|
"eslint": "^9.22.0",
|
|
81
79
|
"nuxt": "^3.16.0",
|
|
@@ -83,7 +81,9 @@
|
|
|
83
81
|
"vitest": "^3.0.8"
|
|
84
82
|
},
|
|
85
83
|
"resolutions": {
|
|
86
|
-
"
|
|
84
|
+
"@unhead/vue": "^2.0.0-rc.13",
|
|
85
|
+
"typescript": "5.6.3",
|
|
86
|
+
"unhead": "^2.0.0-rc.13"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"lint": "eslint . --fix",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare client",
|
|
96
96
|
"release": "pnpm build && bumpp && pnpm -r publish",
|
|
97
97
|
"typecheck": "tsc --noEmit ",
|
|
98
|
-
"test": "nuxi prepare test/fixtures/i18n && nuxi prepare test/fixtures/i18n-domains && vitest"
|
|
98
|
+
"test": "nuxi prepare test/fixtures/i18n && nuxi prepare test/fixtures/i18n-domains && vitest",
|
|
99
|
+
"test:attw": "attw --pack"
|
|
99
100
|
}
|
|
100
101
|
}
|
package/schema.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './dist/schema'
|
|
1
|
+
export * from './dist/schema'
|