File tree Expand file tree Collapse file tree 9 files changed +63
-16
lines changed Expand file tree Collapse file tree 9 files changed +63
-16
lines changed Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
2+ import { notFound } from "next/navigation" ;
3+
4+ import { Cluster , getFeeds } from "../../../services/pyth" ;
25
36export { PriceFeedLayout as default } from "../../../components/PriceFeed/layout" ;
47
5- export const metadata : Metadata = {
6- title : "Price Feeds" ,
8+ type Props = {
9+ params : Promise < {
10+ slug : string ;
11+ } > ;
12+ } ;
13+
14+ export const generateMetadata = async ( {
15+ params,
16+ } : Props ) : Promise < Metadata > => {
17+ const [ { slug } , feeds ] = await Promise . all ( [
18+ params ,
19+ getFeeds ( Cluster . Pythnet ) ,
20+ ] ) ;
21+ const symbol = decodeURIComponent ( slug ) ;
22+ const feed = feeds . find ( ( item ) => item . symbol === symbol ) ;
23+
24+ return feed
25+ ? {
26+ title : feed . product . display_symbol ,
27+ description : `See live market quotes for ${ feed . product . description } .` ,
28+ }
29+ : notFound ( ) ;
730} ;
831
932export const dynamic = "error" ;
Original file line number Diff line number Diff line change 1+ import type { Metadata } from "next" ;
2+
13export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition" ;
4+
5+ export const metadata : Metadata = {
6+ title : {
7+ default : "Price Feeds" ,
8+ template : "%s | Price Feeds | Pyth Network Insights" ,
9+ } ,
10+ description : "Explore market data on the Pyth network." ,
11+ } ;
Original file line number Diff line number Diff line change 1- import type { Metadata } from "next" ;
2-
31export { PriceFeeds as default } from "../../components/PriceFeeds" ;
42
5- export const metadata : Metadata = {
6- title : "Price Feeds" ,
7- } ;
8-
93export const dynamic = "error" ;
104export const revalidate = 3600 ;
Original file line number Diff line number Diff line change 1+ import { lookup } from "@pythnetwork/known-publishers" ;
12import type { Metadata } from "next" ;
23
34export { PublishersLayout as default } from "../../../../components/Publisher/layout" ;
45
5- export const metadata : Metadata = {
6- title : "Publishers" ,
6+ type Props = {
7+ params : Promise < {
8+ key : string ;
9+ } > ;
10+ } ;
11+
12+ export const generateMetadata = async ( {
13+ params,
14+ } : Props ) : Promise < Metadata > => {
15+ const { key } = await params ;
16+ const knownPublisher = lookup ( key ) ;
17+ const publisher = knownPublisher ?. name ?? key ;
18+
19+ return {
20+ title : publisher ,
21+ description : `Evaluate performance for data published by ${ publisher } .` ,
22+ } ;
723} ;
824
925export const dynamic = "error" ;
Original file line number Diff line number Diff line change 1+ import type { Metadata } from "next" ;
2+
13export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition" ;
4+
5+ export const metadata : Metadata = {
6+ title : {
7+ default : "Publishers" ,
8+ template : "%s | Publishers | Pyth Network Insights" ,
9+ } ,
10+ description : "Explore publishers who contribute to the Pyth network." ,
11+ } ;
Original file line number Diff line number Diff line change 1- import type { Metadata } from "next" ;
2-
31export { Publishers as default } from "../../components/Publishers" ;
42
5- export const metadata : Metadata = {
6- title : "Publishers" ,
7- } ;
8-
93export const dynamic = "error" ;
104export const revalidate = 3600 ;
You can’t perform that action at this time.
0 commit comments