nuxt-seo-utils 7.0.4 → 7.0.6
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.d.mts +2 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +1 -1
- package/dist/runtime/app/composables/useBreadcrumbItems.d.ts +3 -0
- package/dist/runtime/app/composables/useBreadcrumbItems.js +64 -43
- package/dist/runtime/app/logic/applyDefaults.d.ts +1 -4
- package/dist/runtime/app/logic/applyDefaults.js +11 -8
- package/dist/runtime/app/plugins/defaults.js +1 -7
- package/dist/runtime/app/plugins/defaultsWaitI18n.js +2 -9
- package/dist/runtime/app/plugins/inferSeoMetaPlugin.js +2 -0
- package/dist/runtime/server/middleware/resolveImagesInPagesDir.d.ts +1 -1
- package/dist/types.d.mts +3 -1
- package/package.json +22 -27
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -114
- package/dist/types.d.ts +0 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -211,7 +211,7 @@ async function getImageMeta(base, path, isIcon = false) {
|
|
|
211
211
|
const altTextPath = resolve(dirname(absolutePath), `${keyword}.alt.txt`);
|
|
212
212
|
if (fs.existsSync(altTextPath)) {
|
|
213
213
|
payload.alt = fs.readFileSync(altTextPath, "utf8");
|
|
214
|
-
payload.alt = payload.alt.replace(/\n/g, " ").trim();
|
|
214
|
+
payload.alt = String(payload.alt).replace(/\n/g, " ").trim();
|
|
215
215
|
}
|
|
216
216
|
} else {
|
|
217
217
|
if (path.includes(".dark") || path.includes("-dark"))
|
|
@@ -68,6 +68,9 @@ export interface BreadcrumbProps {
|
|
|
68
68
|
*/
|
|
69
69
|
rootSegment?: string;
|
|
70
70
|
}
|
|
71
|
+
export type ResolvedBreadcrumbProps = {
|
|
72
|
+
[key in keyof BreadcrumbProps]: BreadcrumbProps[key] extends MaybeRefOrGetter<infer T> ? T : BreadcrumbProps[key];
|
|
73
|
+
};
|
|
71
74
|
export interface BreadcrumbItemProps extends NuxtUIBreadcrumbItem {
|
|
72
75
|
/** Whether the breadcrumb item represents the aria-current. */
|
|
73
76
|
current?: boolean;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineBreadcrumb,
|
|
3
|
-
useI18n,
|
|
4
|
-
useSchemaOrg
|
|
5
|
-
} from "#imports";
|
|
1
|
+
import { defineBreadcrumb, useI18n, useSchemaOrg } from "#imports";
|
|
6
2
|
import { useSiteConfig } from "#site-config/app/composables/useSiteConfig";
|
|
7
3
|
import { createSitePathResolver } from "#site-config/app/composables/utils";
|
|
8
4
|
import { defu } from "defu";
|
|
9
5
|
import { fixSlashes } from "nuxt-site-config/urls";
|
|
10
6
|
import { useNuxtApp, useRoute, useRouter, useState } from "nuxt/app";
|
|
11
7
|
import { withoutTrailingSlash } from "ufo";
|
|
12
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
computed,
|
|
10
|
+
getCurrentInstance,
|
|
11
|
+
inject,
|
|
12
|
+
onScopeDispose,
|
|
13
|
+
onUnmounted,
|
|
14
|
+
provide,
|
|
15
|
+
ref,
|
|
16
|
+
toRaw,
|
|
17
|
+
toValue,
|
|
18
|
+
watch
|
|
19
|
+
} from "vue";
|
|
13
20
|
import { pathBreadcrumbSegments } from "../../shared/breadcrumbs.js";
|
|
14
21
|
function withoutQuery(path) {
|
|
15
22
|
return path.split("?")[0];
|
|
@@ -20,7 +27,13 @@ function titleCase(s) {
|
|
|
20
27
|
const BreadcrumbCtx = Symbol("BreadcrumbCtx");
|
|
21
28
|
export function useBreadcrumbItems(_options = {}) {
|
|
22
29
|
const vm = getCurrentInstance();
|
|
23
|
-
const id = _options.id || "breadcrumb"
|
|
30
|
+
const id = `${vm?.uid || 0}:${_options.id || "breadcrumb"}`;
|
|
31
|
+
const parentChain = [];
|
|
32
|
+
let parent = vm?.parent;
|
|
33
|
+
while (parent) {
|
|
34
|
+
parentChain.push(parent.uid);
|
|
35
|
+
parent = parent.parent;
|
|
36
|
+
}
|
|
24
37
|
const pauseUpdates = ref(import.meta.client);
|
|
25
38
|
let stateRef = null;
|
|
26
39
|
if (vm) {
|
|
@@ -30,17 +43,12 @@ export function useBreadcrumbItems(_options = {}) {
|
|
|
30
43
|
provide(BreadcrumbCtx, stateRef);
|
|
31
44
|
}
|
|
32
45
|
const state = stateRef.value;
|
|
33
|
-
|
|
34
|
-
state[id] = [];
|
|
35
|
-
}
|
|
36
|
-
const idx = state[id].push(_options) - 1;
|
|
46
|
+
state[id] = _options;
|
|
37
47
|
stateRef.value = state;
|
|
38
48
|
onUnmounted(() => {
|
|
39
49
|
const state2 = toRaw(stateRef.value);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
stateRef.value = state2;
|
|
43
|
-
}
|
|
50
|
+
delete state2[id];
|
|
51
|
+
stateRef.value = state2;
|
|
44
52
|
});
|
|
45
53
|
if (import.meta.client) {
|
|
46
54
|
const nuxtApp = useNuxtApp();
|
|
@@ -78,10 +86,33 @@ export function useBreadcrumbItems(_options = {}) {
|
|
|
78
86
|
if (import.meta.client && pauseUpdates.value) {
|
|
79
87
|
return lastBreadcrumbs.value;
|
|
80
88
|
}
|
|
81
|
-
const
|
|
82
|
-
const
|
|
89
|
+
const state = toValue(stateRef) || {};
|
|
90
|
+
const optionStack = [...parentChain, vm?.uid || 0].map((parentId) => state[`${parentId}:${_options.id || "breadcrumb"}`]).filter(Boolean);
|
|
91
|
+
const flatOptions = optionStack.reduce((acc, _cur) => {
|
|
92
|
+
const cur = {};
|
|
93
|
+
Object.entries(_cur).forEach(([key, value]) => {
|
|
94
|
+
cur[key] = toValue(value);
|
|
95
|
+
});
|
|
96
|
+
acc.hideRoot = typeof cur.hideRoot === "undefined" ? acc.hideRoot : cur.hideRoot;
|
|
97
|
+
acc.hideCurrent = typeof cur.hideCurrent === "undefined" ? acc.hideCurrent : cur.hideCurrent;
|
|
83
98
|
acc.rootSegment = acc.rootSegment || cur.rootSegment;
|
|
84
99
|
acc.path = acc.path || cur.path;
|
|
100
|
+
acc.overrides = acc.overrides || [];
|
|
101
|
+
const overrides = toRaw(toValue(cur.overrides));
|
|
102
|
+
if (overrides) {
|
|
103
|
+
overrides.forEach((item, index) => {
|
|
104
|
+
if (item !== void 0) {
|
|
105
|
+
acc.overrides[index] = toRaw(toValue(item));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const prepend = toRaw(toValue(cur.prepend));
|
|
110
|
+
const append = toRaw(toValue(cur.append));
|
|
111
|
+
if (prepend && prepend.length) {
|
|
112
|
+
acc.prepend = [...acc.prepend || [], ...prepend.map((m) => toRaw(toValue(m)))].filter(Boolean);
|
|
113
|
+
}
|
|
114
|
+
if (append && append.length)
|
|
115
|
+
acc.append = [...acc.append || [], ...append.map((m) => toRaw(toValue(m)))].filter(Boolean);
|
|
85
116
|
return acc;
|
|
86
117
|
}, {});
|
|
87
118
|
let rootNode = flatOptions.rootSegment || "/";
|
|
@@ -89,36 +120,22 @@ export function useBreadcrumbItems(_options = {}) {
|
|
|
89
120
|
if (i18n.strategy === "prefix" || i18n.strategy !== "no_prefix" && toValue(i18n.defaultLocale) !== toValue(i18n.locale))
|
|
90
121
|
rootNode = `${rootNode}${toValue(i18n.locale)}`;
|
|
91
122
|
}
|
|
92
|
-
const current = withoutQuery(withoutTrailingSlash(
|
|
93
|
-
const allOverrides = toRaw([...optionStack]).filter(Boolean)?.map((opts) => toValue(opts.overrides)).filter(Boolean);
|
|
94
|
-
const flatOverrides = allOverrides?.reduce((acc, i) => {
|
|
95
|
-
if (i) {
|
|
96
|
-
i.forEach((item, index) => {
|
|
97
|
-
if (item !== void 0) {
|
|
98
|
-
acc[index] = item;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return acc;
|
|
103
|
-
}, []) || {};
|
|
123
|
+
const current = withoutQuery(withoutTrailingSlash(flatOptions.path || toRaw(route).path || rootNode));
|
|
104
124
|
const segments = pathBreadcrumbSegments(current, rootNode).map((path, index) => {
|
|
105
125
|
let item = {
|
|
106
126
|
to: path
|
|
107
127
|
};
|
|
108
|
-
|
|
109
|
-
|
|
128
|
+
const override = flatOptions.overrides[index];
|
|
129
|
+
if (typeof override !== "undefined") {
|
|
130
|
+
if (override === false)
|
|
110
131
|
return false;
|
|
111
|
-
item = defu(
|
|
132
|
+
item = defu(override, item);
|
|
112
133
|
}
|
|
113
134
|
return item;
|
|
114
135
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
segments.unshift(...allPrepends);
|
|
119
|
-
if (allAppends.length)
|
|
120
|
-
segments.push(...allAppends);
|
|
121
|
-
lastBreadcrumbs.value = segments.filter(Boolean).map((item) => {
|
|
136
|
+
segments.unshift(...flatOptions.prepend || []);
|
|
137
|
+
segments.push(...flatOptions.append || []);
|
|
138
|
+
return segments.filter(Boolean).map((item) => {
|
|
122
139
|
let fallbackLabel = titleCase(String((item.to || "").split("/").pop()));
|
|
123
140
|
let fallbackAriaLabel = "";
|
|
124
141
|
const route2 = item.to ? router.resolve(item.to)?.matched?.[0] : null;
|
|
@@ -130,7 +147,7 @@ export function useBreadcrumbItems(_options = {}) {
|
|
|
130
147
|
...routeMeta.breadcrumb
|
|
131
148
|
};
|
|
132
149
|
}
|
|
133
|
-
const routeName = String(route2.name).split("___")[0];
|
|
150
|
+
const routeName = String(route2.name).split("___")?.[0];
|
|
134
151
|
if (routeName === "index") {
|
|
135
152
|
fallbackLabel = "Home";
|
|
136
153
|
}
|
|
@@ -141,19 +158,23 @@ export function useBreadcrumbItems(_options = {}) {
|
|
|
141
158
|
item.label = item.label || fallbackLabel;
|
|
142
159
|
item.ariaLabel = item.ariaLabel || fallbackAriaLabel || item.label;
|
|
143
160
|
item.current = item.current || item.to === current;
|
|
144
|
-
if (
|
|
161
|
+
if (flatOptions.hideCurrent && item.current)
|
|
145
162
|
return false;
|
|
146
163
|
return item;
|
|
147
164
|
}).map((m) => {
|
|
148
165
|
if (m && m.to) {
|
|
149
166
|
m.to = fixSlashes(siteConfig.trailingSlash, m.to);
|
|
150
|
-
if (m.to === rootNode &&
|
|
167
|
+
if (m.to === rootNode && flatOptions.hideRoot)
|
|
151
168
|
return false;
|
|
152
169
|
}
|
|
153
170
|
return m;
|
|
154
171
|
}).filter(Boolean);
|
|
155
|
-
return lastBreadcrumbs.value;
|
|
156
172
|
});
|
|
173
|
+
watch(items, (newItems) => {
|
|
174
|
+
if (!pauseUpdates.value) {
|
|
175
|
+
lastBreadcrumbs.value = newItems;
|
|
176
|
+
}
|
|
177
|
+
}, { immediate: true });
|
|
157
178
|
const schemaOrgEnabled = typeof _options.schemaOrg === "undefined" ? true : _options.schemaOrg;
|
|
158
179
|
if ((import.meta.dev || import.meta.server || import.meta.env?.NODE_ENV === "test") && schemaOrgEnabled) {
|
|
159
180
|
useSchemaOrg([
|
|
@@ -4,12 +4,14 @@ import { createSitePathResolver } from "#site-config/app/composables/utils";
|
|
|
4
4
|
import { TemplateParamsPlugin } from "@unhead/vue/plugins";
|
|
5
5
|
import { useError, useRoute, useRuntimeConfig } from "nuxt/app";
|
|
6
6
|
import { stringifyQuery } from "ufo";
|
|
7
|
-
import { computed } from "vue";
|
|
8
|
-
export function applyDefaults(
|
|
7
|
+
import { computed, toValue } from "vue";
|
|
8
|
+
export function applyDefaults() {
|
|
9
|
+
const siteConfig = useSiteConfig({
|
|
10
|
+
resolveRefs: false
|
|
11
|
+
});
|
|
9
12
|
const head = injectHead();
|
|
10
13
|
head.use(TemplateParamsPlugin);
|
|
11
14
|
const { canonicalQueryWhitelist, canonicalLowercase } = useRuntimeConfig().public["seo-utils"];
|
|
12
|
-
const siteConfig = useSiteConfig();
|
|
13
15
|
const route = useRoute();
|
|
14
16
|
const resolveUrl = createSitePathResolver({ withBase: true, absolute: true });
|
|
15
17
|
const err = useError();
|
|
@@ -38,7 +40,7 @@ export function applyDefaults(i18n) {
|
|
|
38
40
|
tagPriority: "low"
|
|
39
41
|
};
|
|
40
42
|
useHead({
|
|
41
|
-
htmlAttrs: { lang:
|
|
43
|
+
htmlAttrs: { lang: siteConfig.currentLocale },
|
|
42
44
|
templateParams: {
|
|
43
45
|
site: () => siteConfig,
|
|
44
46
|
siteName: () => siteConfig.name
|
|
@@ -53,10 +55,11 @@ export function applyDefaults(i18n) {
|
|
|
53
55
|
return url ? url.href : false;
|
|
54
56
|
},
|
|
55
57
|
ogLocale: () => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const locale = toValue(siteConfig.currentLocale);
|
|
59
|
+
if (locale) {
|
|
60
|
+
const l = locale.replace("-", "_");
|
|
61
|
+
if (l.includes("_")) {
|
|
62
|
+
return l;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
return false;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { useSiteConfig } from "#site-config/app/composables/useSiteConfig";
|
|
2
1
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
|
-
import { ref } from "vue";
|
|
4
2
|
import { applyDefaults } from "../logic/applyDefaults.js";
|
|
5
3
|
export default defineNuxtPlugin({
|
|
6
4
|
name: "nuxt-seo:defaults",
|
|
@@ -9,10 +7,6 @@ export default defineNuxtPlugin({
|
|
|
9
7
|
islands: false
|
|
10
8
|
},
|
|
11
9
|
setup() {
|
|
12
|
-
|
|
13
|
-
const locale = ref(siteConfig.currentLocale || siteConfig.defaultLocale);
|
|
14
|
-
applyDefaults({
|
|
15
|
-
locale
|
|
16
|
-
});
|
|
10
|
+
applyDefaults();
|
|
17
11
|
}
|
|
18
12
|
});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { useSiteConfig } from "#site-config/app/composables/useSiteConfig";
|
|
2
1
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
|
-
import { ref } from "vue";
|
|
4
2
|
import { applyDefaults } from "../logic/applyDefaults.js";
|
|
5
3
|
export default defineNuxtPlugin({
|
|
6
4
|
name: "nuxt-seo:defaults",
|
|
@@ -9,12 +7,7 @@ export default defineNuxtPlugin({
|
|
|
9
7
|
},
|
|
10
8
|
// we need to wait for the i18n plugin to run first
|
|
11
9
|
dependsOn: ["nuxt-site-config:i18n"],
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
const locale = ref(nuxtApp.$i18n?.locale?.value || siteConfig.currentLocale || siteConfig.defaultLocale);
|
|
15
|
-
nuxtApp.hook("i18n:localeSwitched", ({ newLocale }) => {
|
|
16
|
-
locale.value = newLocale;
|
|
17
|
-
});
|
|
18
|
-
applyDefaults({ locale });
|
|
10
|
+
setup() {
|
|
11
|
+
applyDefaults();
|
|
19
12
|
}
|
|
20
13
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { injectHead } from "#imports";
|
|
2
2
|
import { InferSeoMetaPlugin } from "@unhead/addons";
|
|
3
3
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
4
|
+
import { TemplateParamsPlugin } from "unhead/plugins";
|
|
4
5
|
export default defineNuxtPlugin(() => {
|
|
5
6
|
const head = injectHead();
|
|
6
7
|
if (!head)
|
|
7
8
|
return;
|
|
9
|
+
head.use(TemplateParamsPlugin);
|
|
8
10
|
head.use(InferSeoMetaPlugin());
|
|
9
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer | undefined>>;
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike> | undefined>>;
|
|
2
2
|
export default _default;
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.6",
|
|
5
5
|
"description": "SEO utilities to improve your Nuxt sites discoverability and shareability",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -15,13 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types": "./dist/types.d.
|
|
19
|
-
"import": "./dist/module.mjs"
|
|
20
|
-
"require": "./dist/module.cjs"
|
|
18
|
+
"types": "./dist/types.d.mts",
|
|
19
|
+
"import": "./dist/module.mjs"
|
|
21
20
|
}
|
|
22
21
|
},
|
|
23
|
-
"main": "./dist/module.
|
|
24
|
-
"types": "./dist/types.d.ts",
|
|
22
|
+
"main": "./dist/module.mjs",
|
|
25
23
|
"files": [
|
|
26
24
|
"dist"
|
|
27
25
|
],
|
|
@@ -34,13 +32,13 @@
|
|
|
34
32
|
]
|
|
35
33
|
},
|
|
36
34
|
"dependencies": {
|
|
37
|
-
"@nuxt/kit": "^3.16.
|
|
38
|
-
"@unhead/addons": "^2.0.
|
|
35
|
+
"@nuxt/kit": "^3.16.2",
|
|
36
|
+
"@unhead/addons": "^2.0.4",
|
|
39
37
|
"defu": "^6.1.4",
|
|
40
38
|
"escape-string-regexp": "^5.0.0",
|
|
41
39
|
"fast-glob": "^3.3.3",
|
|
42
|
-
"image-size": "^2.0.
|
|
43
|
-
"nuxt-site-config": "^3.1.
|
|
40
|
+
"image-size": "^2.0.2",
|
|
41
|
+
"nuxt-site-config": "^3.1.7",
|
|
44
42
|
"pathe": "^2.0.3",
|
|
45
43
|
"pkg-types": "^2.1.0",
|
|
46
44
|
"scule": "^1.3.0",
|
|
@@ -48,33 +46,30 @@
|
|
|
48
46
|
"ufo": "^1.5.4"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
51
|
-
"@antfu/eslint-config": "4.
|
|
52
|
-
"@nuxt/module-builder": "^0.
|
|
53
|
-
"@nuxt/schema": "3.16.
|
|
49
|
+
"@antfu/eslint-config": "4.11.0",
|
|
50
|
+
"@nuxt/module-builder": "^1.0.0",
|
|
51
|
+
"@nuxt/schema": "3.16.2",
|
|
54
52
|
"@nuxt/test-utils": "^3.17.2",
|
|
55
|
-
"@nuxt/ui": "^3.0.
|
|
53
|
+
"@nuxt/ui": "^3.0.2",
|
|
56
54
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
57
|
-
"@nuxtjs/i18n": "^9.
|
|
58
|
-
"@
|
|
55
|
+
"@nuxtjs/i18n": "^9.5.2",
|
|
56
|
+
"@types/node": "^22.14.0",
|
|
57
|
+
"@unhead/vue": "2.0.4",
|
|
59
58
|
"@vue/test-utils": "^2.4.6",
|
|
60
59
|
"bumpp": "^10.1.0",
|
|
61
|
-
"case-police": "^
|
|
60
|
+
"case-police": "^2.0.0",
|
|
62
61
|
"cheerio": "1.0.0",
|
|
63
|
-
"eslint": "^9.
|
|
62
|
+
"eslint": "^9.24.0",
|
|
64
63
|
"happy-dom": "^17.4.4",
|
|
65
64
|
"markdownlint-cli": "^0.44.0",
|
|
66
|
-
"nuxt": "
|
|
65
|
+
"nuxt": "3.16.2",
|
|
67
66
|
"nuxt-content-twoslash": "^0.1.2",
|
|
68
|
-
"playwright-core": "^1.51.
|
|
69
|
-
"sass": "^1.
|
|
70
|
-
"typescript": "5.8.
|
|
71
|
-
"vitest": "^3.
|
|
67
|
+
"playwright-core": "^1.51.1",
|
|
68
|
+
"sass": "^1.86.3",
|
|
69
|
+
"typescript": "5.8.3",
|
|
70
|
+
"vitest": "^3.1.1",
|
|
72
71
|
"vue-tsc": "^2.2.8"
|
|
73
72
|
},
|
|
74
|
-
"resolutions": {
|
|
75
|
-
"nuxt": "3.16.0",
|
|
76
|
-
"typescript": "5.6.3"
|
|
77
|
-
},
|
|
78
73
|
"scripts": {
|
|
79
74
|
"lint": "eslint . --fix",
|
|
80
75
|
"stub": "nuxt-build-module build --stub && nuxt-module-build prepare",
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { MetaFlatSerializable } from '../dist/runtime/types.js';
|
|
3
|
-
|
|
4
|
-
interface ModuleOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the SEO experiements should run.
|
|
7
|
-
*
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
enabled: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Should the files in the public directory be used to infer tags such as favicon, apple-touch-icon, and
|
|
13
|
-
* open graph images.
|
|
14
|
-
*
|
|
15
|
-
* @default true
|
|
16
|
-
*/
|
|
17
|
-
metaDataFiles: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Should head data be inferred from the current input to fill in the gaps.
|
|
20
|
-
*
|
|
21
|
-
* For example:
|
|
22
|
-
* - If you supply a title, this will automatically add an og:title.
|
|
23
|
-
* - If you provide an og:image, it will automatically add a twitter:image.
|
|
24
|
-
*
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
automaticOgAndTwitterTags: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Attempts to treeshake the `useSeoMeta` function. Can save around 5kb in the client bundle.
|
|
30
|
-
*
|
|
31
|
-
* @default true
|
|
32
|
-
*/
|
|
33
|
-
treeShakeUseSeoMeta: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Injects site config into the `useHead` composable such as setting the title template
|
|
36
|
-
*
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
mergeWithSiteConfig: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Adds `head` and `seoMeta` to the route rules and app config.
|
|
42
|
-
*
|
|
43
|
-
* @default true
|
|
44
|
-
*/
|
|
45
|
-
extendRouteRules: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Tries to convert relative image paths to absolute paths in meta tags.
|
|
48
|
-
*
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
fixRequiredAbsoluteMetaTagsLinks: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Extends the `head` in the Nuxt config with the `seoMeta` object.
|
|
54
|
-
*
|
|
55
|
-
* @default true
|
|
56
|
-
*/
|
|
57
|
-
extendNuxtConfigAppHeadSeoMeta: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Augments the head schema with `/public` files making it easier to reference them in the head.
|
|
60
|
-
*
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
extendNuxtConfigAppHeadTypes: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* @dead
|
|
66
|
-
*/
|
|
67
|
-
setupNuxtConfigAppHeadWithMoreDefaults: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Will ensure a title is always set by providing a fallback title based on the casing the last slug segment.
|
|
70
|
-
*
|
|
71
|
-
* @default true
|
|
72
|
-
*/
|
|
73
|
-
fallbackTitle?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Will set up a number of defaults for meta tags and Schema.org, if the modules and config are available.
|
|
76
|
-
*
|
|
77
|
-
* @default true
|
|
78
|
-
*/
|
|
79
|
-
automaticDefaults?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* When enabled, it will whitelist the query parameters that are allowed in the canonical URL.
|
|
82
|
-
*/
|
|
83
|
-
canonicalQueryWhitelist?: string[];
|
|
84
|
-
/**
|
|
85
|
-
* When enabled, it will lowercase the canonical URL.
|
|
86
|
-
*
|
|
87
|
-
* @default true
|
|
88
|
-
*/
|
|
89
|
-
canonicalLowercase?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* When enabled, it will redirect any request to the canonical domain (site url) using a 301 redirect on non-dev environments.
|
|
92
|
-
*
|
|
93
|
-
* E.g if the site url is 'www.example.com' and the user visits 'example.com',
|
|
94
|
-
* they will be redirected to 'www.example.com'.
|
|
95
|
-
*
|
|
96
|
-
* This is useful for SEO as it prevents duplicate content and consolidates page rank.
|
|
97
|
-
*
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
redirectToCanonicalSiteUrl?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* The SEO meta object to be used as defaults.
|
|
103
|
-
*/
|
|
104
|
-
meta: MetaFlatSerializable;
|
|
105
|
-
/**
|
|
106
|
-
* Enables debug logs and a debug endpoint.
|
|
107
|
-
*
|
|
108
|
-
* @default false
|
|
109
|
-
*/
|
|
110
|
-
debug: boolean;
|
|
111
|
-
}
|
|
112
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
113
|
-
|
|
114
|
-
export { type ModuleOptions, _default as default };
|
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|