Skip to content

Commit 31a2ea4

Browse files
Merge pull request #3323 from pyth-network/add-videos
feat(docs): embed Youtube videos in the docs
2 parents 4479b9a + 8eb394b commit 31a2ea4

File tree

8 files changed

+58
-0
lines changed

8 files changed

+58
-0
lines changed

apps/developer-hub/content/docs/entropy/protocol-design.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Understanding how Pyth Entropy generates secure random numbers
44
icon: Book
55
---
66

7+
<YouTubeEmbed id="KOfe2KQOmew" title="How Pyth Entropy Works" />
8+
79
The Entropy protocol implements a secure 2-party random number generation procedure. The protocol
810
is an extension of a simple commit/reveal protocol. The original version has the following steps:
911

apps/developer-hub/content/docs/entropy/whats-new-entropyv2.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: New features and improvements in Entropy v2
44
icon: Sparkle
55
---
66

7+
<YouTubeEmbed id="8WGkCjlIg58" title="What's New in Entropy v2" />
8+
79
## Key Improvements
810

911
Pyth Entropy v2 brings new features and improvements that make random number generation more flexible, efficient, and easier to integrate.

apps/developer-hub/content/docs/price-feeds/core/fetch-price-updates.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ slug: /price-feeds/core/fetch-price-updates
66

77
import { Callout } from "fumadocs-ui/components/callout";
88

9+
<YouTubeEmbed
10+
id="sIF9lswg_HY"
11+
title="The Most Effective Way to Get Prices Onchain"
12+
/>
13+
914
The following guide explains how to fetch price updates.
1015
Price updates can be submitted to the Pyth Price Feeds contract to update the on-chain price.
1116
Please see [What is a Pull Oracle?](/price-feeds/core/pull-updates) to learn more.

apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ description: Design Overview - Understand the high-level architecture of the Pyt
44
slug: /price-feeds/core/how-pyth-works
55
---
66

7+
<YouTubeEmbed
8+
id="PWo_56qlSx8"
9+
title="How Pyth Prices Differ From Other Oracles"
10+
/>
11+
712
Pyth is a protocol that allows market participants to publish pricing information on-chain for others to use. The protocol is an interaction between three parties:
813

914
1. _Publishers_ submit pricing information to Pyth's oracle program. Pyth has multiple data publishers for every product to improve the accuracy and robustness of the system.

apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ slug: /price-feeds/core/use-real-time-data
66

77
import { Callout } from "fumadocs-ui/components/callout";
88

9+
<YouTubeEmbed
10+
id="25lIVs8b2Ho"
11+
title="Different Approaches to Integrate Pyth Prices"
12+
/>
13+
914
The following guides demonstrate how to consume Pyth real-time prices on various blockchains.
1015
These guides are intended for developers building on-chain applications that need the latest price data, i.e., the price data must
1116
be on the blockchain.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@use "@pythnetwork/component-library/theme";
2+
3+
.iframe {
4+
width: 100%;
5+
aspect-ratio: 16 / 9;
6+
margin: theme.spacing(6) 0;
7+
border: none;
8+
border-radius: theme.border-radius("xl");
9+
background-color: theme.color("background", "primary");
10+
box-shadow: 0 4px 24px rgb(0 0 0 / 12%);
11+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import clsx from "clsx";
2+
3+
import styles from "./index.module.scss";
4+
5+
type YouTubeEmbedProps = {
6+
id: string;
7+
title?: string;
8+
className?: string;
9+
};
10+
11+
export const YouTubeEmbed = ({
12+
id,
13+
title = "YouTube video player",
14+
className,
15+
}: YouTubeEmbedProps) => (
16+
<iframe
17+
className={clsx(styles.iframe, className)}
18+
src={`https://www.youtube.com/embed/${id}`}
19+
title={title}
20+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
21+
referrerPolicy="strict-origin-when-cross-origin"
22+
allowFullScreen
23+
/>
24+
);
25+
26+
export default YouTubeEmbed;

apps/developer-hub/src/mdx-components.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import defaultMdxComponents from "fumadocs-ui/mdx";
66
import type { MDXComponents } from "mdx/types";
77

88
import { APICard, APICards } from "./components/APICard";
9+
import { YouTubeEmbed } from "./components/YouTubeEmbed";
910
import { openapi } from "./lib/openapi";
1011

1112
export function getMDXComponents(components?: MDXComponents): MDXComponents {
@@ -20,5 +21,6 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
2021
Tab,
2122
...components,
2223
InfoBox: InfoBox,
24+
YouTubeEmbed,
2325
};
2426
}

0 commit comments

Comments
 (0)