Skip to content

Commit 7495ca8

Browse files
committed
Added downloadPoster attribute to the docs
1 parent 1d95f1c commit 7495ca8

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

docs/src/content/docs/components/link-preview.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,32 @@ The `<LinkPreview>` component supports the following API for controlling its sty
105105
- `.link-preview--no-media`: Class applied to the card when it includes no image or video.
106106
- `.link-preview--no-metadata`: Class applied when metadata scraping failed, or no valid title was found. In this case the only contents of the card is the original URL link.
107107

108+
## Optional props
109+
110+
In addition to the required `id` prop, the following props are available to customise how the `<LinkPreview>` component renders:
111+
112+
### `downloadPoster`
113+
114+
**Type:** `boolean`
115+
116+
Download the poster image and host it on the same server as your website.
117+
118+
This attribute can only be used if the `og:image` metadata exists.
119+
120+
```astro
121+
<LinkPreview id="https://astro.build/blog/welcome-world/" downloadPoster />
122+
```
123+
124+
To use the `downloadPoster` attribute, need to add the address of the image server to astro.config.mjs as follows:
125+
126+
```js
127+
export default defineConfig({
128+
image: {
129+
domains: ['astro.build'],
130+
},
131+
});
132+
```
133+
108134
## Standalone installation
109135

110136
If you only need the `<LinkPreview>` component, you can install the package directly instead of the main `astro-embed` package:

docs/src/content/docs/components/vimeo.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,27 @@ If you want to customise this, for example to match the language of your website
110110
<Vimeo id="32001208" playlabel="Play the video" />
111111
```
112112

113+
### `downloadPoster`
114+
115+
**Type:** `boolean`
116+
117+
Download the poster image and host it on the same server as your website.
118+
119+
```astro
120+
<Vimeo id="32001208" downloadPoster />
121+
```
122+
123+
To use the `downloadPoster` attribute, need to add the address of the image server to astro.config.mjs as follows:
124+
125+
126+
```js
127+
export default defineConfig({
128+
image: {
129+
domains: ['i.vimeocdn.com'],
130+
},
131+
});
132+
```
133+
113134
## Standalone installation
114135

115136
If you only need the `<Vimeo>` component, you can install the package directly instead of the main `astro-embed` package:

docs/src/content/docs/components/youtube.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,27 @@ Set a visible title to overlay on the video.
128128
title="The Astro Community: where contributors find a home"
129129
/>
130130

131+
### `downloadPoster`
132+
133+
**Type:** `boolean`
134+
135+
Download the poster image and host it on the same server as your website.
136+
137+
```astro
138+
<YouTube id="TtRtkTzHVBU" downloadPoster />
139+
```
140+
141+
To use the `downloadPoster` attribute, need to add the address of the image server to astro.config.mjs as follows:
142+
143+
144+
```js
145+
export default defineConfig({
146+
image: {
147+
domains: ['i.ytimg.com'],
148+
},
149+
});
150+
```
151+
131152
## Standalone installation
132153

133154
If you only need the `<YouTube>` component, you can install the package directly instead of the main `astro-embed` package:

0 commit comments

Comments
 (0)