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 1
1
import type { Metadata } from "next" ;
2
+ import { notFound } from "next/navigation" ;
3
+
4
+ import { Cluster , getFeeds } from "../../../services/pyth" ;
2
5
3
6
export { PriceFeedLayout as default } from "../../../components/PriceFeed/layout" ;
4
7
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 ( ) ;
7
30
} ;
8
31
9
32
export const dynamic = "error" ;
Original file line number Diff line number Diff line change
1
+ import type { Metadata } from "next" ;
2
+
1
3
export { 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
-
3
1
export { PriceFeeds as default } from "../../components/PriceFeeds" ;
4
2
5
- export const metadata : Metadata = {
6
- title : "Price Feeds" ,
7
- } ;
8
-
9
3
export const dynamic = "error" ;
10
4
export const revalidate = 3600 ;
Original file line number Diff line number Diff line change
1
+ import { lookup } from "@pythnetwork/known-publishers" ;
1
2
import type { Metadata } from "next" ;
2
3
3
4
export { PublishersLayout as default } from "../../../../components/Publisher/layout" ;
4
5
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
+ } ;
7
23
} ;
8
24
9
25
export const dynamic = "error" ;
Original file line number Diff line number Diff line change
1
+ import type { Metadata } from "next" ;
2
+
1
3
export { 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
-
3
1
export { Publishers as default } from "../../components/Publishers" ;
4
2
5
- export const metadata : Metadata = {
6
- title : "Publishers" ,
7
- } ;
8
-
9
3
export const dynamic = "error" ;
10
4
export const revalidate = 3600 ;
You can’t perform that action at this time.
0 commit comments