@webnumseoagent/next 0.1.20 → 0.1.21
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/client.ts +9 -1
- package/dist/client.js +7 -0
- package/package.json +1 -1
package/client.ts
CHANGED
|
@@ -20,7 +20,11 @@ interface SeoFields {
|
|
|
20
20
|
title?: string;
|
|
21
21
|
description?: string;
|
|
22
22
|
canonical?: string;
|
|
23
|
-
robots?: {
|
|
23
|
+
robots?: {
|
|
24
|
+
index?: boolean; follow?: boolean; noarchive?: boolean; nosnippet?: boolean; noimageindex?: boolean;
|
|
25
|
+
// Расширенные директивы (RankMath «Advanced Robots»): предел сниппета, превью видео, размер превью картинок.
|
|
26
|
+
maxSnippet?: number; maxVideoPreview?: number; maxImagePreview?: "none" | "standard" | "large";
|
|
27
|
+
};
|
|
24
28
|
og?: { title?: string; description?: string; image?: string; siteName?: string; locale?: string };
|
|
25
29
|
twitter?: { card?: string; image?: string; site?: string };
|
|
26
30
|
facebook?: { appId?: string; admins?: string }; // fb:app_id / fb:admins (admins — через запятую)
|
|
@@ -165,6 +169,10 @@ function mergeIntoMetadata(fallback: Metadata, f: SeoFields, route: string): Met
|
|
|
165
169
|
if (r.noarchive) base.noarchive = true;
|
|
166
170
|
if (r.nosnippet) base.nosnippet = true;
|
|
167
171
|
if (r.noimageindex) base.noimageindex = true;
|
|
172
|
+
// Расширенные директивы — ключи с дефисом, как их ждёт Next (эмитятся в <meta name="robots">).
|
|
173
|
+
if (typeof r.maxSnippet === "number") base["max-snippet"] = r.maxSnippet;
|
|
174
|
+
if (typeof r.maxVideoPreview === "number") base["max-video-preview"] = r.maxVideoPreview;
|
|
175
|
+
if (r.maxImagePreview) base["max-image-preview"] = r.maxImagePreview;
|
|
168
176
|
m.robots = base as Metadata["robots"];
|
|
169
177
|
}
|
|
170
178
|
if (f.og) {
|
package/dist/client.js
CHANGED
|
@@ -172,6 +172,13 @@ function mergeIntoMetadata(fallback, f, route) {
|
|
|
172
172
|
base.nosnippet = true;
|
|
173
173
|
if (r.noimageindex)
|
|
174
174
|
base.noimageindex = true;
|
|
175
|
+
// Расширенные директивы — ключи с дефисом, как их ждёт Next (эмитятся в <meta name="robots">).
|
|
176
|
+
if (typeof r.maxSnippet === "number")
|
|
177
|
+
base["max-snippet"] = r.maxSnippet;
|
|
178
|
+
if (typeof r.maxVideoPreview === "number")
|
|
179
|
+
base["max-video-preview"] = r.maxVideoPreview;
|
|
180
|
+
if (r.maxImagePreview)
|
|
181
|
+
base["max-image-preview"] = r.maxImagePreview;
|
|
175
182
|
m.robots = base;
|
|
176
183
|
}
|
|
177
184
|
if (f.og) {
|
package/package.json
CHANGED