Metadata
The document metadata of a route or layout (the metadata export, or what generateMetadata returns).
The document metadata of a route or layout (the metadata export, or what generateMetadata returns). Every
field is optional and each one has a documented rule for how layers combine (see merge.ts).
Import#
ts
import type { Metadata } from "@shadow-js/dusk";
Signature#
ts
interface Metadata {
/** Base for relative URLs (canonical, Open Graph, icons, manifest, alternates). */
readonly metadataBase?: URL | string | null;
readonly title?: MetadataTitle | null;
readonly description?: string | null;
readonly applicationName?: string;
readonly authors?: Author | readonly Author[];
readonly generator?: string;
readonly keywords?: string | readonly string[];
readonly referrer?: ReferrerPolicy;
readonly themeColor?: string | ThemeColorDescriptor | readonly ThemeColorDescriptor[];
readonly colorScheme?: ColorScheme;
/** A viewport string written as is. Prefer the `viewport` export, which builds it from fields. */
readonly viewport?: string | ViewportFields;
readonly creator?: string;
readonly publisher?: string;
readonly robots?: string | Robots;
readonly alternates?: Alternates;
readonly icons?: Icons;
readonly manifest?: MetadataUrl;
readonly openGraph?: OpenGraph;
readonly twitter?: TwitterMetadata;
readonly verification?: Verification;
readonly appleWebApp?: AppleWebApp | true;
readonly formatDetection?: FormatDetection;
readonly itunes?: ItunesApp;
readonly facebook?: FacebookMetadata;
readonly pinterest?: { readonly richPin?: boolean };
readonly appLinks?: AppLinks;
readonly archives?: MetadataUrl | readonly MetadataUrl[];
readonly assets?: MetadataUrl | readonly MetadataUrl[];
readonly bookmarks?: MetadataUrl | readonly MetadataUrl[];
readonly category?: string;
readonly classification?: string;
/** Extra `<meta name>` tags. */
readonly other?: OtherMetadata;
/** JSON-LD structured data: each value becomes one `<script type="application/ld+json">`. */
readonly jsonLd?: JsonLdValue | readonly JsonLdValue[];
}
Members#
| Name | Type | Description |
|---|---|---|
metadataBase? |
readonly metadataBase?: URL | string | null |
Base for relative URLs (canonical, Open Graph, icons, manifest, alternates). |
title? |
readonly title?: MetadataTitle | null |
|
description? |
readonly description?: string | null |
|
applicationName? |
readonly applicationName?: string |
|
authors? |
readonly authors?: Author | readonly Author[] |
|
generator? |
readonly generator?: string |
|
keywords? |
readonly keywords?: string | readonly string[] |
|
referrer? |
readonly referrer?: ReferrerPolicy |
|
themeColor? |
readonly themeColor?: string | ThemeColorDescriptor | readonly ThemeColorDescriptor[] |
|
colorScheme? |
readonly colorScheme?: ColorScheme |
|
viewport? |
readonly viewport?: string | ViewportFields |
A viewport string written as is. Prefer the viewport export, which builds it from fields. |
creator? |
readonly creator?: string |
|
publisher? |
readonly publisher?: string |
|
robots? |
readonly robots?: string | Robots |
|
alternates? |
readonly alternates?: Alternates |
|
icons? |
readonly icons?: Icons |
|
manifest? |
readonly manifest?: MetadataUrl |
|
openGraph? |
readonly openGraph?: OpenGraph |
|
twitter? |
readonly twitter?: TwitterMetadata |
|
verification? |
readonly verification?: Verification |
|
appleWebApp? |
readonly appleWebApp?: AppleWebApp | true |
|
formatDetection? |
readonly formatDetection?: FormatDetection |
|
itunes? |
readonly itunes?: ItunesApp |
|
facebook? |
readonly facebook?: FacebookMetadata |
|
pinterest? |
readonly pinterest?: { readonly richPin?: boolean } |
|
appLinks? |
readonly appLinks?: AppLinks |
|
archives? |
readonly archives?: MetadataUrl | readonly MetadataUrl[] |
|
assets? |
readonly assets?: MetadataUrl | readonly MetadataUrl[] |
|
bookmarks? |
readonly bookmarks?: MetadataUrl | readonly MetadataUrl[] |
|
category? |
readonly category?: string |
|
classification? |
readonly classification?: string |
|
other? |
readonly other?: OtherMetadata |
Extra <meta name> tags. |
jsonLd? |
readonly jsonLd?: JsonLdValue | readonly JsonLdValue[] |
JSON-LD structured data: each value becomes one <script type="application/ld+json">. |