diff --git a/apps/insights/src/app/opengraph-image.png b/apps/insights/src/app/opengraph-image.png new file mode 100644 index 0000000000..fbe53924bf Binary files /dev/null and b/apps/insights/src/app/opengraph-image.png differ diff --git a/apps/insights/src/app/price-feeds/[slug]/layout.ts b/apps/insights/src/app/price-feeds/[slug]/layout.ts index ec22c9599c..34bbe99738 100644 --- a/apps/insights/src/app/price-feeds/[slug]/layout.ts +++ b/apps/insights/src/app/price-feeds/[slug]/layout.ts @@ -1,9 +1,32 @@ import type { Metadata } from "next"; +import { notFound } from "next/navigation"; + +import { Cluster, getFeeds } from "../../../services/pyth"; export { PriceFeedLayout as default } from "../../../components/PriceFeed/layout"; -export const metadata: Metadata = { - title: "Price Feeds", +type Props = { + params: Promise<{ + slug: string; + }>; +}; + +export const generateMetadata = async ({ + params, +}: Props): Promise => { + const [{ slug }, feeds] = await Promise.all([ + params, + getFeeds(Cluster.Pythnet), + ]); + const symbol = decodeURIComponent(slug); + const feed = feeds.find((item) => item.symbol === symbol); + + return feed + ? { + title: feed.product.display_symbol, + description: `See live market quotes for ${feed.product.description}.`, + } + : notFound(); }; export const dynamic = "error"; diff --git a/apps/insights/src/app/price-feeds/layout.ts b/apps/insights/src/app/price-feeds/layout.ts index cbaf9a9d4b..356243f82e 100644 --- a/apps/insights/src/app/price-feeds/layout.ts +++ b/apps/insights/src/app/price-feeds/layout.ts @@ -1 +1,11 @@ +import type { Metadata } from "next"; + export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition"; + +export const metadata: Metadata = { + title: { + default: "Price Feeds", + template: "%s | Price Feeds | Pyth Network Insights", + }, + description: "Explore market data on the Pyth network.", +}; diff --git a/apps/insights/src/app/price-feeds/opengraph-image.png b/apps/insights/src/app/price-feeds/opengraph-image.png new file mode 100644 index 0000000000..f24fb40d50 Binary files /dev/null and b/apps/insights/src/app/price-feeds/opengraph-image.png differ diff --git a/apps/insights/src/app/price-feeds/page.ts b/apps/insights/src/app/price-feeds/page.ts index ba0bbf4869..4f5be74d0d 100644 --- a/apps/insights/src/app/price-feeds/page.ts +++ b/apps/insights/src/app/price-feeds/page.ts @@ -1,10 +1,4 @@ -import type { Metadata } from "next"; - export { PriceFeeds as default } from "../../components/PriceFeeds"; -export const metadata: Metadata = { - title: "Price Feeds", -}; - export const dynamic = "error"; export const revalidate = 3600; diff --git a/apps/insights/src/app/publishers/[cluster]/[key]/layout.ts b/apps/insights/src/app/publishers/[cluster]/[key]/layout.ts index fdf3c17532..190b693df9 100644 --- a/apps/insights/src/app/publishers/[cluster]/[key]/layout.ts +++ b/apps/insights/src/app/publishers/[cluster]/[key]/layout.ts @@ -1,9 +1,25 @@ +import { lookup } from "@pythnetwork/known-publishers"; import type { Metadata } from "next"; export { PublishersLayout as default } from "../../../../components/Publisher/layout"; -export const metadata: Metadata = { - title: "Publishers", +type Props = { + params: Promise<{ + key: string; + }>; +}; + +export const generateMetadata = async ({ + params, +}: Props): Promise => { + const { key } = await params; + const knownPublisher = lookup(key); + const publisher = knownPublisher?.name ?? key; + + return { + title: publisher, + description: `Evaluate performance for data published by ${publisher}.`, + }; }; export const dynamic = "error"; diff --git a/apps/insights/src/app/publishers/layout.ts b/apps/insights/src/app/publishers/layout.ts index cbaf9a9d4b..c4d4ea35eb 100644 --- a/apps/insights/src/app/publishers/layout.ts +++ b/apps/insights/src/app/publishers/layout.ts @@ -1 +1,11 @@ +import type { Metadata } from "next"; + export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition"; + +export const metadata: Metadata = { + title: { + default: "Publishers", + template: "%s | Publishers | Pyth Network Insights", + }, + description: "Explore publishers who contribute to the Pyth network.", +}; diff --git a/apps/insights/src/app/publishers/opengraph-image.png b/apps/insights/src/app/publishers/opengraph-image.png new file mode 100644 index 0000000000..0669f64719 Binary files /dev/null and b/apps/insights/src/app/publishers/opengraph-image.png differ diff --git a/apps/insights/src/app/publishers/page.ts b/apps/insights/src/app/publishers/page.ts index 6b090ff42e..8c0e52ec30 100644 --- a/apps/insights/src/app/publishers/page.ts +++ b/apps/insights/src/app/publishers/page.ts @@ -1,10 +1,4 @@ -import type { Metadata } from "next"; - export { Publishers as default } from "../../components/Publishers"; -export const metadata: Metadata = { - title: "Publishers", -}; - export const dynamic = "error"; export const revalidate = 3600;