next 15.2.0-canary.47 → 15.2.0-canary.48
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/app-dir/link.d.ts +108 -28
- package/dist/client/app-dir/link.js +6 -4
- package/dist/client/app-dir/link.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +3 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +8 -6
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js +2 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +39 -13
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +13 -3
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +6 -6
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/app-dir/link.js +6 -4
- package/dist/esm/client/app-dir/link.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +3 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +8 -6
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js +2 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +39 -13
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -3
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/metadata/types/metadata-interface.js +13 -1
- package/dist/esm/lib/metadata/types/metadata-interface.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/patch-error-inspect.js +42 -15
- package/dist/esm/server/patch-error-inspect.js.map +1 -1
- package/dist/lib/metadata/types/metadata-interface.d.ts +252 -179
- package/dist/lib/metadata/types/metadata-interface.js +13 -1
- package/dist/lib/metadata/types/metadata-interface.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/patch-error-inspect.js +42 -15
- package/dist/server/patch-error-inspect.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js Metadata API
|
|
3
|
+
*
|
|
4
|
+
* This file defines the types used by Next.js to configure metadata
|
|
5
|
+
* through static exports or dynamic `generateMetadata` functions in Server Components.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* - The static `metadata` object and `generateMetadata` function are only supported in Server Components.
|
|
9
|
+
* - Do not export both a `metadata` object and a `generateMetadata` function from the same route segment.
|
|
10
|
+
* - You can still render metadata in client components directly as part of the component's JSX.
|
|
11
|
+
*
|
|
12
|
+
* @see https://nextjs.org/docs/app/api-reference/metadata
|
|
13
|
+
*/
|
|
1
14
|
import type { AlternateURLs, Languages, ResolvedAlternateURLs } from './alternative-urls-types';
|
|
2
15
|
import type { AppleWebApp, AppLinks, Facebook, FormatDetection, ItunesApp, ResolvedAppleWebApp, ResolvedAppLinks, ResolvedFacebook, ViewportLayout } from './extra-types';
|
|
3
16
|
import type { DeprecatedMetadataFields, AbsoluteTemplateString, Author, ColorSchemeEnum, Icon, Icons, IconURL, ReferrerEnum, ResolvedIcons, ResolvedVerification, Robots, ResolvedRobots, TemplateString, Verification, ThemeColorDescriptor, Videos } from './metadata-types';
|
|
@@ -6,349 +19,363 @@ import type { OpenGraph, ResolvedOpenGraph } from './opengraph-types';
|
|
|
6
19
|
import type { ResolvedTwitterMetadata, Twitter } from './twitter-types';
|
|
7
20
|
/**
|
|
8
21
|
* Metadata interface to describe all the metadata fields that can be set in a document.
|
|
9
|
-
*
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This interface covers all the metadata fields available in Next.js including title, description,
|
|
25
|
+
* icons, openGraph, twitter, and more. Fields such as `metadataBase` help in composing absolute URLs
|
|
26
|
+
* from relative ones. The `title` field supports both simple strings and a template object with `default`,
|
|
27
|
+
* `template`, and `absolute` properties.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Static metadata export in a layout or page:
|
|
32
|
+
* import type { Metadata } from 'next'
|
|
33
|
+
*
|
|
34
|
+
* export const metadata: Metadata = {
|
|
35
|
+
* metadataBase: new URL('https://example.com'),
|
|
36
|
+
* title: { default: 'My Site', template: '%s | My Site' },
|
|
37
|
+
* description: 'Welcome to My Site',
|
|
38
|
+
* alternates: {
|
|
39
|
+
* canonical: 'https://example.com',
|
|
40
|
+
* languages: {
|
|
41
|
+
* 'en-US': 'https://example.com/en-US',
|
|
42
|
+
* 'de-DE': 'https://example.com/de-DE'
|
|
43
|
+
* }
|
|
44
|
+
* },
|
|
45
|
+
* openGraph: {
|
|
46
|
+
* title: 'My Site',
|
|
47
|
+
* description: 'Welcome to My Site',
|
|
48
|
+
* url: 'https://example.com',
|
|
49
|
+
* siteName: 'My Site',
|
|
50
|
+
* images: [{ url: 'https://example.com/og.png' }]
|
|
51
|
+
* },
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
10
54
|
*/
|
|
11
55
|
interface Metadata extends DeprecatedMetadataFields {
|
|
12
56
|
/**
|
|
13
|
-
* The base path and origin for absolute
|
|
57
|
+
* The base path and origin for absolute URLs in various metadata fields.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* When relative URLs (for Open Graph images, alternates, etc.) are used, they are composed with this base.
|
|
61
|
+
* If not provided, Next.js will populate a default value based on environment variables.
|
|
14
62
|
*/
|
|
15
63
|
metadataBase?: null | URL | undefined;
|
|
16
64
|
/**
|
|
17
65
|
* The document title.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* The title can be a simple string (e.g., `"My Blog"`) or an object with:
|
|
69
|
+
* - `default`: A fallback title for child segments.
|
|
70
|
+
* - `template`: A title template (e.g., `"%s | My Website"`) applied to child titles.
|
|
71
|
+
* - `absolute`: A title that overrides parent templates.
|
|
72
|
+
*
|
|
18
73
|
* @example
|
|
19
74
|
* ```tsx
|
|
20
|
-
*
|
|
21
|
-
*
|
|
75
|
+
* // As a simple string:
|
|
76
|
+
* title: "My Blog"
|
|
22
77
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
78
|
+
* // As a template object:
|
|
79
|
+
* title: { default: "Dashboard", template: "%s | My Website" }
|
|
25
80
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
81
|
+
* // Using absolute value (ignores parent template):
|
|
82
|
+
* title: { absolute: "My Blog", template: "%s | My Website" }
|
|
28
83
|
* ```
|
|
29
84
|
*/
|
|
30
85
|
title?: null | string | TemplateString | undefined;
|
|
31
86
|
/**
|
|
32
|
-
* The document description, and optionally the
|
|
87
|
+
* The document description, and optionally the Open Graph and Twitter descriptions.
|
|
88
|
+
*
|
|
33
89
|
* @example
|
|
34
90
|
* ```tsx
|
|
35
|
-
* "My Blog Description"
|
|
36
|
-
* <meta name="description" content="My Blog Description" />
|
|
91
|
+
* description: "My Blog Description"
|
|
92
|
+
* // Renders: <meta name="description" content="My Blog Description" />
|
|
37
93
|
* ```
|
|
38
94
|
*/
|
|
39
95
|
description?: null | string | undefined;
|
|
40
96
|
/**
|
|
41
97
|
* The application name.
|
|
98
|
+
*
|
|
42
99
|
* @example
|
|
43
100
|
* ```tsx
|
|
44
|
-
* "My Blog"
|
|
45
|
-
* <meta name="application-name" content="My Blog" />
|
|
101
|
+
* applicationName: "My Blog"
|
|
102
|
+
* // Renders: <meta name="application-name" content="My Blog" />
|
|
46
103
|
* ```
|
|
47
104
|
*/
|
|
48
105
|
applicationName?: null | string | undefined;
|
|
49
106
|
/**
|
|
50
107
|
* The authors of the document.
|
|
108
|
+
*
|
|
51
109
|
* @example
|
|
52
110
|
* ```tsx
|
|
53
|
-
* [{ name: "Next.js Team", url: "https://nextjs.org" }]
|
|
54
|
-
*
|
|
55
|
-
* <meta name="author" content="Next.js Team" />
|
|
56
|
-
* <link rel="author" href="https://nextjs.org" />
|
|
111
|
+
* authors: [{ name: "Next.js Team", url: "https://nextjs.org" }]
|
|
112
|
+
* // Renders:
|
|
113
|
+
* // <meta name="author" content="Next.js Team" />
|
|
114
|
+
* // <link rel="author" href="https://nextjs.org" />
|
|
57
115
|
* ```
|
|
58
116
|
*/
|
|
59
117
|
authors?: null | Author | Array<Author> | undefined;
|
|
60
118
|
/**
|
|
61
119
|
* The generator used for the document.
|
|
120
|
+
*
|
|
62
121
|
* @example
|
|
63
122
|
* ```tsx
|
|
64
|
-
* "Next.js"
|
|
65
|
-
*
|
|
66
|
-
* <meta name="generator" content="Next.js" />
|
|
123
|
+
* generator: "Next.js"
|
|
124
|
+
* // Renders: <meta name="generator" content="Next.js" />
|
|
67
125
|
* ```
|
|
68
126
|
*/
|
|
69
127
|
generator?: null | string | undefined;
|
|
70
128
|
/**
|
|
71
|
-
* The keywords for the document.
|
|
129
|
+
* The keywords for the document.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* When an array is provided, keywords are flattened into a comma-separated string.
|
|
133
|
+
*
|
|
72
134
|
* @example
|
|
73
135
|
* ```tsx
|
|
74
|
-
* "nextjs, react, blog"
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* ["react", "server components"]
|
|
78
|
-
* <meta name="keywords" content="react, server components" />
|
|
136
|
+
* keywords: "nextjs, react, blog"
|
|
137
|
+
* // or
|
|
138
|
+
* keywords: ["react", "server components"]
|
|
79
139
|
* ```
|
|
80
140
|
*/
|
|
81
141
|
keywords?: null | string | Array<string> | undefined;
|
|
82
142
|
/**
|
|
83
143
|
* The referrer setting for the document.
|
|
144
|
+
*
|
|
84
145
|
* @example
|
|
85
146
|
* ```tsx
|
|
86
|
-
* "origin"
|
|
87
|
-
* <meta name="referrer" content="origin" />
|
|
147
|
+
* referrer: "origin"
|
|
148
|
+
* // Renders: <meta name="referrer" content="origin" />
|
|
88
149
|
* ```
|
|
89
150
|
*/
|
|
90
151
|
referrer?: null | ReferrerEnum | undefined;
|
|
91
152
|
/**
|
|
92
153
|
* The theme color for the document.
|
|
93
|
-
* @deprecated Use `export const viewport: Viewport = { ... }` instead.
|
|
94
|
-
* @see https://nextjs.org/docs/app/api-reference/functions/generate-viewport#the-viewport-object
|
|
95
|
-
* @example
|
|
96
|
-
* ```tsx
|
|
97
|
-
* "#000000"
|
|
98
|
-
* <meta name="theme-color" content="#000000" />
|
|
99
|
-
*
|
|
100
|
-
* { media: "(prefers-color-scheme: dark)", color: "#000000" }
|
|
101
|
-
* <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
102
154
|
*
|
|
103
|
-
*
|
|
104
|
-
* { media: "(prefers-color-scheme: dark)", color: "#000000" },
|
|
105
|
-
* { media: "(prefers-color-scheme: light)", color: "#ffffff" }
|
|
106
|
-
* ]
|
|
107
|
-
* <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
108
|
-
* <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
|
|
109
|
-
* ```
|
|
155
|
+
* @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.
|
|
110
156
|
*/
|
|
111
157
|
themeColor?: null | string | ThemeColorDescriptor | ThemeColorDescriptor[] | undefined;
|
|
112
158
|
/**
|
|
113
159
|
* The color scheme for the document.
|
|
114
|
-
*
|
|
115
|
-
* @
|
|
116
|
-
* @example
|
|
117
|
-
* ```tsx
|
|
118
|
-
* "dark"
|
|
119
|
-
* <meta name="color-scheme" content="dark" />
|
|
120
|
-
* ```
|
|
160
|
+
*
|
|
161
|
+
* @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.
|
|
121
162
|
*/
|
|
122
163
|
colorScheme?: null | ColorSchemeEnum | undefined;
|
|
123
164
|
/**
|
|
124
165
|
* The viewport setting for the document.
|
|
125
|
-
*
|
|
126
|
-
* @
|
|
127
|
-
* @example
|
|
128
|
-
* ```tsx
|
|
129
|
-
* { width: "device-width", initialScale: 1 }
|
|
130
|
-
* <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
131
|
-
* ```
|
|
166
|
+
*
|
|
167
|
+
* @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.
|
|
132
168
|
*/
|
|
133
169
|
viewport?: null | string | ViewportLayout | undefined;
|
|
134
170
|
/**
|
|
135
171
|
* The creator of the document.
|
|
172
|
+
*
|
|
136
173
|
* @example
|
|
137
174
|
* ```tsx
|
|
138
|
-
* "Next.js Team"
|
|
139
|
-
* <meta name="creator" content="Next.js Team" />
|
|
175
|
+
* creator: "Next.js Team"
|
|
176
|
+
* // Renders: <meta name="creator" content="Next.js Team" />
|
|
140
177
|
* ```
|
|
141
178
|
*/
|
|
142
179
|
creator?: null | string | undefined;
|
|
143
180
|
/**
|
|
144
181
|
* The publisher of the document.
|
|
145
|
-
* @example
|
|
146
182
|
*
|
|
183
|
+
* @example
|
|
147
184
|
* ```tsx
|
|
148
|
-
* "Vercel"
|
|
149
|
-
* <meta name="publisher" content="Vercel" />
|
|
185
|
+
* publisher: "Vercel"
|
|
186
|
+
* // Renders: <meta name="publisher" content="Vercel" />
|
|
150
187
|
* ```
|
|
151
188
|
*/
|
|
152
189
|
publisher?: null | string | undefined;
|
|
153
190
|
/**
|
|
154
191
|
* The robots setting for the document.
|
|
155
192
|
*
|
|
156
|
-
* @
|
|
193
|
+
* @remarks
|
|
194
|
+
* Can be a string (e.g., "index, follow") or an object with more granular rules.
|
|
195
|
+
*
|
|
157
196
|
* @example
|
|
158
197
|
* ```tsx
|
|
159
|
-
* "index, follow"
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* { index: false, follow: false }
|
|
163
|
-
* <meta name="robots" content="noindex, nofollow" />
|
|
198
|
+
* robots: "index, follow"
|
|
199
|
+
* // or
|
|
200
|
+
* robots: { index: true, follow: true }
|
|
164
201
|
* ```
|
|
202
|
+
*
|
|
203
|
+
* @see https://developer.mozilla.org/docs/Glossary/Robots.txt
|
|
165
204
|
*/
|
|
166
205
|
robots?: null | string | Robots | undefined;
|
|
167
206
|
/**
|
|
168
207
|
* The canonical and alternate URLs for the document.
|
|
169
|
-
* @example
|
|
170
|
-
* ```tsx
|
|
171
|
-
* { canonical: "https://example.com" }
|
|
172
|
-
* <link rel="canonical" href="https://example.com" />
|
|
173
208
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* <link rel="alternate" href="https://example.com/en-US" hreflang="en-US" />
|
|
177
|
-
* ```
|
|
209
|
+
* @remarks
|
|
210
|
+
* This field allows defining a canonical URL as well as alternate URLs (such as for multiple languages).
|
|
178
211
|
*
|
|
179
|
-
*
|
|
212
|
+
* @example
|
|
180
213
|
* ```tsx
|
|
181
|
-
* {
|
|
214
|
+
* alternates: {
|
|
182
215
|
* canonical: "https://example.com",
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* { url: 'blog/js.rss', title: 'js title' },
|
|
187
|
-
* ],
|
|
188
|
-
* },
|
|
216
|
+
* languages: {
|
|
217
|
+
* "en-US": "https://example.com/en-US"
|
|
218
|
+
* }
|
|
189
219
|
* }
|
|
190
|
-
* <link rel="canonical" href="https://example.com" />
|
|
191
|
-
* <link rel="alternate" href="https://example.com/blog.rss" type="application/rss+xml" title="rss" />
|
|
192
|
-
* <link rel="alternate" href="https://example.com/blog/js.rss" type="application/rss+xml" title="js title" />
|
|
193
220
|
* ```
|
|
194
221
|
*/
|
|
195
222
|
alternates?: null | AlternateURLs | undefined;
|
|
196
223
|
/**
|
|
197
224
|
* The icons for the document. Defaults to rel="icon".
|
|
198
225
|
*
|
|
199
|
-
* @
|
|
226
|
+
* @remarks
|
|
227
|
+
* You can specify a simple URL or an object to differentiate between icon types (e.g., apple-touch-icon).
|
|
228
|
+
*
|
|
200
229
|
* @example
|
|
201
230
|
* ```tsx
|
|
202
|
-
* "https://example.com/icon.png"
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* [{ rel: "icon", url: "https://example.com/icon.png" }, { rel: "apple-touch-icon", url: "https://example.com/apple-icon.png" }]
|
|
210
|
-
* <link rel="icon" href="https://example.com/icon.png" />
|
|
211
|
-
* <link rel="apple-touch-icon" href="https://example.com/apple-icon.png" />
|
|
231
|
+
* icons: "https://example.com/icon.png"
|
|
232
|
+
* // or
|
|
233
|
+
* icons: {
|
|
234
|
+
* icon: "https://example.com/icon.png",
|
|
235
|
+
* apple: "https://example.com/apple-icon.png"
|
|
236
|
+
* }
|
|
212
237
|
* ```
|
|
238
|
+
*
|
|
239
|
+
* @see https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-icon
|
|
213
240
|
*/
|
|
214
241
|
icons?: null | IconURL | Array<Icon> | Icons | undefined;
|
|
215
242
|
/**
|
|
216
243
|
* A web application manifest, as defined in the Web Application Manifest specification.
|
|
217
244
|
*
|
|
218
|
-
* @see https://developer.mozilla.org/docs/Web/Manifest
|
|
219
245
|
* @example
|
|
220
246
|
* ```tsx
|
|
221
|
-
* "https://example.com/manifest.json"
|
|
222
|
-
* <link rel="manifest" href="https://example.com/manifest.json" />
|
|
247
|
+
* manifest: "https://example.com/manifest.json"
|
|
248
|
+
* // Renders: <link rel="manifest" href="https://example.com/manifest.json" />
|
|
223
249
|
* ```
|
|
224
250
|
*
|
|
251
|
+
* @see https://developer.mozilla.org/docs/Web/Manifest
|
|
225
252
|
*/
|
|
226
253
|
manifest?: null | string | URL | undefined;
|
|
227
254
|
/**
|
|
228
255
|
* The Open Graph metadata for the document.
|
|
229
256
|
*
|
|
230
|
-
* @
|
|
257
|
+
* @remarks
|
|
258
|
+
* Follows the Open Graph protocol to enrich link previews.
|
|
259
|
+
*
|
|
231
260
|
* @example
|
|
232
261
|
* ```tsx
|
|
233
|
-
* {
|
|
262
|
+
* openGraph: {
|
|
234
263
|
* type: "website",
|
|
235
264
|
* url: "https://example.com",
|
|
236
265
|
* title: "My Website",
|
|
237
266
|
* description: "My Website Description",
|
|
238
267
|
* siteName: "My Website",
|
|
239
|
-
* images: [{
|
|
240
|
-
* url: "https://example.com/og.png",
|
|
241
|
-
* }],
|
|
268
|
+
* images: [{ url: "https://example.com/og.png" }]
|
|
242
269
|
* }
|
|
243
|
-
*
|
|
244
|
-
* <meta property="og:type" content="website" />
|
|
245
|
-
* <meta property="og:url" content="https://example.com" />
|
|
246
|
-
* <meta property="og:site_name" content="My Website" />
|
|
247
|
-
* <meta property="og:title" content="My Website" />
|
|
248
|
-
* <meta property="og:description" content="My Website Description" />
|
|
249
|
-
* <meta property="og:image" content="https://example.com/og.png" />
|
|
250
270
|
* ```
|
|
271
|
+
*
|
|
272
|
+
* @see https://ogp.me/
|
|
251
273
|
*/
|
|
252
274
|
openGraph?: null | OpenGraph | undefined;
|
|
253
275
|
/**
|
|
254
276
|
* The Twitter metadata for the document.
|
|
277
|
+
*
|
|
278
|
+
* @remarks
|
|
279
|
+
* - Used for configuring Twitter Cards and can include details such as `card`, `site`, and `creator`.
|
|
280
|
+
* - Notably, more sites than just Twitter (now X) use this format.
|
|
281
|
+
*
|
|
255
282
|
* @example
|
|
256
283
|
* ```tsx
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* <meta name="twitter:description" content="My Website Description" />
|
|
264
|
-
* <meta name="twitter:image" content="https://example.com/og.png" />
|
|
284
|
+
* twitter: {
|
|
285
|
+
* card: "summary_large_image",
|
|
286
|
+
* site: "@site",
|
|
287
|
+
* creator: "@creator",
|
|
288
|
+
* images: "https://example.com/og.png"
|
|
289
|
+
* }
|
|
265
290
|
* ```
|
|
266
|
-
*
|
|
267
291
|
*/
|
|
268
292
|
twitter?: null | Twitter | undefined;
|
|
269
293
|
/**
|
|
270
294
|
* The Facebook metadata for the document.
|
|
271
|
-
* You can specify either appId or admins, but not both.
|
|
272
|
-
* @example
|
|
273
|
-
* ```tsx
|
|
274
|
-
* { appId: "12345678" }
|
|
275
295
|
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
296
|
+
* @remarks
|
|
297
|
+
* Specify either `appId` or `admins` (but not both) to configure Facebook integration.
|
|
278
298
|
*
|
|
279
299
|
* @example
|
|
280
300
|
* ```tsx
|
|
281
|
-
* {
|
|
282
|
-
*
|
|
283
|
-
*
|
|
301
|
+
* facebook: { appId: "12345678" }
|
|
302
|
+
* // Renders <meta property="fb:app_id" content="12345678" />
|
|
303
|
+
* // or
|
|
304
|
+
* facebook: { admins: ["12345678"] }
|
|
305
|
+
* // Renders <meta property="fb:admins" content="12345678" />
|
|
284
306
|
* ```
|
|
285
307
|
*/
|
|
286
308
|
facebook?: null | Facebook | undefined;
|
|
287
309
|
/**
|
|
288
310
|
* The common verification tokens for the document.
|
|
311
|
+
*
|
|
289
312
|
* @example
|
|
290
313
|
* ```tsx
|
|
291
|
-
*
|
|
292
|
-
* <meta name="google-site-verification" content="1234567890" />
|
|
293
|
-
* <meta name="yandex-verification" content="1234567890" />
|
|
294
|
-
* <meta name="me" content="@me" />
|
|
314
|
+
* verification: { google: "1234567890", yandex: "1234567890", "me": "1234567890" }
|
|
315
|
+
* // Renders <meta name="google-site-verification" content="1234567890" />
|
|
316
|
+
* // <meta name="yandex-verification" content="1234567890" />
|
|
317
|
+
* // <meta name="me" content="@me" />
|
|
295
318
|
* ```
|
|
296
319
|
*/
|
|
297
320
|
verification?: Verification | undefined;
|
|
298
321
|
/**
|
|
299
322
|
* The Apple web app metadata for the document.
|
|
300
323
|
*
|
|
301
|
-
* @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
|
|
302
324
|
* @example
|
|
303
325
|
* ```tsx
|
|
304
|
-
* { capable: true, title: "My Website", statusBarStyle: "black-translucent" }
|
|
305
|
-
* <meta name="mobile-web-app-capable" content="yes" />
|
|
306
|
-
* <meta name="apple-mobile-web-app-title" content="My Website" />
|
|
307
|
-
* <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
326
|
+
* appleWebApp: { capable: true, title: "My Website", statusBarStyle: "black-translucent" }
|
|
308
327
|
* ```
|
|
309
328
|
*
|
|
329
|
+
* @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
|
|
310
330
|
*/
|
|
311
331
|
appleWebApp?: null | boolean | AppleWebApp | undefined;
|
|
312
332
|
/**
|
|
313
|
-
* Indicates
|
|
314
|
-
*
|
|
333
|
+
* Indicates whether devices should interpret certain formats (such as telephone numbers) as actionable links.
|
|
334
|
+
*
|
|
315
335
|
* @example
|
|
316
336
|
* ```tsx
|
|
317
|
-
* { telephone: false }
|
|
318
|
-
* <meta name="format-detection" content="telephone=no" />
|
|
337
|
+
* formatDetection: { telephone: false }
|
|
338
|
+
* // Renders: <meta name="format-detection" content="telephone=no" />
|
|
319
339
|
* ```
|
|
320
|
-
*
|
|
321
340
|
*/
|
|
322
341
|
formatDetection?: null | FormatDetection | undefined;
|
|
323
342
|
/**
|
|
324
343
|
* The metadata for the iTunes App.
|
|
325
|
-
*
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* Adds the `name="apple-itunes-app"` meta tag.
|
|
326
347
|
*
|
|
327
348
|
* @example
|
|
328
349
|
* ```tsx
|
|
329
|
-
* { app: { id: "123456789", affiliateData: "123456789", appArguments: "123456789" } }
|
|
330
|
-
* <meta name="apple-itunes-app" content="app-id=123456789, affiliate-data=123456789, app-arguments=123456789" />
|
|
350
|
+
* itunes: { app: { id: "123456789", affiliateData: "123456789", appArguments: "123456789" } }
|
|
351
|
+
* // Renders <meta name="apple-itunes-app" content="app-id=123456789, affiliate-data=123456789, app-arguments=123456789" />
|
|
331
352
|
* ```
|
|
332
353
|
*/
|
|
333
354
|
itunes?: null | ItunesApp | undefined;
|
|
334
355
|
/**
|
|
335
|
-
* A brief description of
|
|
336
|
-
*
|
|
356
|
+
* A brief description of the web page.
|
|
357
|
+
*
|
|
358
|
+
* @remarks
|
|
359
|
+
* Rendered as the `abstract` meta tag. This is *not recommended* as it is superseded by `description`.
|
|
337
360
|
*
|
|
338
|
-
* @see https://www.metatags.org/all-meta-tags-overview/meta-name-abstract/
|
|
339
361
|
* @example
|
|
340
362
|
* ```tsx
|
|
341
|
-
* "My Website Description"
|
|
342
|
-
* <meta name="abstract" content="My Website Description" />
|
|
363
|
+
* abstract: "My Website Description"
|
|
364
|
+
* // Renders <meta name="abstract" content="My Website Description" />
|
|
343
365
|
* ```
|
|
344
366
|
*/
|
|
345
367
|
abstract?: null | string | undefined;
|
|
346
368
|
/**
|
|
347
369
|
* The Facebook AppLinks metadata for the document.
|
|
370
|
+
*
|
|
348
371
|
* @example
|
|
349
372
|
* ```tsx
|
|
350
|
-
*
|
|
373
|
+
* appLinks: {
|
|
374
|
+
* ios: { appStoreId: "123456789", url: "https://example.com" },
|
|
375
|
+
* android: { packageName: "com.example", url: "https://example.com" }
|
|
376
|
+
* }
|
|
351
377
|
*
|
|
378
|
+
* // Renders
|
|
352
379
|
* <meta property="al:ios:app_store_id" content="123456789" />
|
|
353
380
|
* <meta property="al:ios:url" content="https://example.com" />
|
|
354
381
|
* <meta property="al:android:package" content="com.example" />
|
|
@@ -358,41 +385,53 @@ interface Metadata extends DeprecatedMetadataFields {
|
|
|
358
385
|
appLinks?: null | AppLinks | undefined;
|
|
359
386
|
/**
|
|
360
387
|
* The archives link rel property.
|
|
388
|
+
*
|
|
361
389
|
* @example
|
|
362
390
|
* ```tsx
|
|
363
|
-
*
|
|
364
|
-
* <link rel="archives" href="https://example.com/archives" />
|
|
391
|
+
* archives: "https://example.com/archives"
|
|
392
|
+
* // Renders <link rel="archives" href="https://example.com/archives" />
|
|
365
393
|
* ```
|
|
366
394
|
*/
|
|
367
395
|
archives?: null | string | Array<string> | undefined;
|
|
368
396
|
/**
|
|
369
397
|
* The assets link rel property.
|
|
398
|
+
*
|
|
370
399
|
* @example
|
|
371
400
|
* ```tsx
|
|
372
|
-
* "https://example.com/assets"
|
|
373
|
-
* <link rel="assets" href="https://example.com/assets" />
|
|
401
|
+
* assets: "https://example.com/assets"
|
|
402
|
+
* // Renders <link rel="assets" href="https://example.com/assets" />
|
|
374
403
|
* ```
|
|
375
404
|
*/
|
|
376
405
|
assets?: null | string | Array<string> | undefined;
|
|
377
406
|
/**
|
|
378
407
|
* The bookmarks link rel property.
|
|
408
|
+
*
|
|
409
|
+
* @remarks
|
|
410
|
+
* Although technically against the HTML spec, this is used in practice.
|
|
411
|
+
*
|
|
379
412
|
* @example
|
|
380
413
|
* ```tsx
|
|
381
|
-
* "https://example.com/bookmarks"
|
|
382
|
-
* <link rel="bookmarks" href="https://example.com/bookmarks" />
|
|
414
|
+
* bookmarks: "https://example.com/bookmarks"
|
|
415
|
+
* // Renders <link rel="bookmarks" href="https://example.com/bookmarks" />
|
|
383
416
|
* ```
|
|
384
417
|
*/
|
|
385
418
|
bookmarks?: null | string | Array<string> | undefined;
|
|
386
419
|
/**
|
|
387
420
|
* The pagination link rel properties.
|
|
388
421
|
*
|
|
389
|
-
* @see https://developers.google.com/search/blog/2011/09/pagination-with-relnext-and-relprev
|
|
390
422
|
* @example
|
|
391
423
|
* ```tsx
|
|
392
|
-
*
|
|
424
|
+
* pagination: {
|
|
425
|
+
* previous: "https://example.com/items?page=1",
|
|
426
|
+
* next: "https://example.com/items?page=3"
|
|
427
|
+
* }
|
|
428
|
+
*
|
|
429
|
+
* // Renders
|
|
393
430
|
* <link rel="prev" href="https://example.com/items?page=1" />
|
|
394
431
|
* <link rel="next" href="https://example.com/items?page=3" />
|
|
395
432
|
* ```
|
|
433
|
+
*
|
|
434
|
+
* @see https://developers.google.com/search/blog/2011/09/pagination-with-relnext-and-relprev
|
|
396
435
|
*/
|
|
397
436
|
pagination?: {
|
|
398
437
|
previous?: null | string | URL | undefined;
|
|
@@ -400,29 +439,43 @@ interface Metadata extends DeprecatedMetadataFields {
|
|
|
400
439
|
};
|
|
401
440
|
/**
|
|
402
441
|
* The category meta name property.
|
|
442
|
+
*
|
|
403
443
|
* @example
|
|
404
444
|
* ```tsx
|
|
405
|
-
* "My Category"
|
|
406
|
-
* <meta name="category" content="My Category" />
|
|
445
|
+
* category: "My Category"
|
|
446
|
+
* // Renders <meta name="category" content="My Category" />
|
|
407
447
|
* ```
|
|
408
448
|
*/
|
|
409
449
|
category?: null | string | undefined;
|
|
410
450
|
/**
|
|
411
451
|
* The classification meta name property.
|
|
452
|
+
*
|
|
412
453
|
* @example
|
|
413
454
|
* ```tsx
|
|
414
|
-
* "My Classification"
|
|
415
|
-
* <meta name="classification" content="My Classification" />
|
|
455
|
+
* classification: "My Classification"
|
|
456
|
+
* // Renders <meta name="classification" content="My Classification" />
|
|
416
457
|
* ```
|
|
417
458
|
*/
|
|
418
459
|
classification?: null | string | undefined;
|
|
419
460
|
/**
|
|
420
|
-
* Arbitrary name/value pairs for
|
|
461
|
+
* Arbitrary name/value pairs for additional metadata.
|
|
462
|
+
*
|
|
463
|
+
* @remarks
|
|
464
|
+
* Use this field to define custom meta tags that are not directly supported.
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```tsx
|
|
468
|
+
* other: { custom: ["meta1", "meta2"] }
|
|
469
|
+
* ```
|
|
421
470
|
*/
|
|
422
471
|
other?: ({
|
|
423
472
|
[name: string]: string | number | Array<string | number>;
|
|
424
473
|
} & DeprecatedMetadataFields) | undefined;
|
|
425
474
|
}
|
|
475
|
+
/**
|
|
476
|
+
* ResolvedMetadata represents the fully processed metadata after defaults are applied
|
|
477
|
+
* and relative URLs are composed with `metadataBase`.
|
|
478
|
+
*/
|
|
426
479
|
interface ResolvedMetadata extends DeprecatedMetadataFields {
|
|
427
480
|
metadataBase: null | URL;
|
|
428
481
|
title: null | AbsoluteTemplateString;
|
|
@@ -504,34 +557,54 @@ declare namespace MetadataRoute {
|
|
|
504
557
|
type Sitemap = SitemapFile;
|
|
505
558
|
type Manifest = ManifestFile;
|
|
506
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Interface for the viewport configuration.
|
|
562
|
+
*
|
|
563
|
+
* @remarks
|
|
564
|
+
* This configuration allows defining properties such as width, initial scale, theme colors,
|
|
565
|
+
* and color scheme.
|
|
566
|
+
*
|
|
567
|
+
* @example
|
|
568
|
+
* ```tsx
|
|
569
|
+
* export const viewport: Viewport = {
|
|
570
|
+
* width: "device-width",
|
|
571
|
+
* initialScale: 1,
|
|
572
|
+
* themeColor: [
|
|
573
|
+
* { media: "(prefers-color-scheme: dark)", color: "#000000" },
|
|
574
|
+
* { media: "(prefers-color-scheme: light)", color: "#ffffff" }
|
|
575
|
+
* ],
|
|
576
|
+
* colorScheme: "dark"
|
|
577
|
+
* }
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
507
580
|
interface Viewport extends ViewportLayout {
|
|
508
581
|
/**
|
|
509
582
|
* The theme color for the document.
|
|
510
|
-
* @example
|
|
511
583
|
*
|
|
584
|
+
* @example
|
|
512
585
|
* ```tsx
|
|
513
|
-
* "#000000"
|
|
514
|
-
* <meta name="theme-color" content="#000000" />
|
|
586
|
+
* themeColor: "#000000"
|
|
587
|
+
* // Renders <meta name="theme-color" content="#000000" />
|
|
515
588
|
*
|
|
516
|
-
* { media: "(prefers-color-scheme: dark)", color: "#000000" }
|
|
517
|
-
* <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
589
|
+
* themeColor: { media: "(prefers-color-scheme: dark)", color: "#000000" }
|
|
590
|
+
* // Renders <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
518
591
|
*
|
|
519
|
-
* [
|
|
592
|
+
* themeColor: [
|
|
520
593
|
* { media: "(prefers-color-scheme: dark)", color: "#000000" },
|
|
521
594
|
* { media: "(prefers-color-scheme: light)", color: "#ffffff" }
|
|
522
595
|
* ]
|
|
523
|
-
* <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
524
|
-
* <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
|
|
596
|
+
* // Renders <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
|
|
597
|
+
* // Renders <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
|
|
525
598
|
* ```
|
|
526
599
|
*/
|
|
527
600
|
themeColor?: null | string | ThemeColorDescriptor | ThemeColorDescriptor[] | undefined;
|
|
528
601
|
/**
|
|
529
602
|
* The color scheme for the document.
|
|
530
|
-
* @example
|
|
531
603
|
*
|
|
604
|
+
* @example
|
|
532
605
|
* ```tsx
|
|
533
|
-
* "dark"
|
|
534
|
-
* <meta name="color-scheme" content="dark" />
|
|
606
|
+
* colorScheme: "dark"
|
|
607
|
+
* // Renders <meta name="color-scheme" content="dark" />
|
|
535
608
|
* ```
|
|
536
609
|
*/
|
|
537
610
|
colorScheme?: null | ColorSchemeEnum | undefined;
|