Skip to main content

Configuration

Plugin options

The defaults scan docs, blog, and src/pages for literal url props on RichLinkCard and LinkCard elements.

OptionTypeDefaultDescription
includestring[]['docs', 'blog', 'src/pages']Source directories scanned for rich-link URLs.
cacheDirstringnode_modules/.cache/docusaurus-plugin-embedsDirectory used for fetched link metadata.
cacheTimenumber86400000Cache lifetime in milliseconds.
export default {
plugins: [
[
'docusaurus-plugin-embeds',
{
include: ['docs', 'src/pages'],
cacheDir: '.cache/embeds',
cacheTime: 7 * 24 * 60 * 60 * 1000,
},
],
],
};

Expressions such as url={article.url} can't be found during the scan. Supply title, description, and other metadata directly for dynamic URLs.

Shared card props

RichLinkCard, GitHubRepoCard, and NpmPackageCard accept className, style, and fallback. The fallback value can be link, compact, or hidden.

<RichLinkCard>

PropTypeRequiredDefaultDescription
urlstringYesAbsolute HTTP or HTTPS destination.
titlestringNoOverrides the fetched title.
descriptionstringNoOverrides the fetched description.
imagestringNoOverrides the fetched preview image.
siteNamestringNoOverrides the fetched site name.
faviconstringNoOverrides the fetched favicon.
fallbacklink | compact | hiddenNolinkRendering used when metadata isn't available.

<GitHubRepoCard> and <NpmPackageCard>

GitHubRepoCard requires repo in owner/name format. NpmPackageCard requires package, including its scope when applicable. Both fetch public data in the browser and accept the shared card props.

The plugin doesn't accept API tokens. Proxy or prefetch the data if your site needs authenticated requests, fixed build output, or a strict content security policy.

<YouTube>

PropTypeRequiredDefaultDescription
idstringYesYouTube video ID.
titlestringNoYouTube video playerAccessible iframe title.
aspectRatioCSS aspect-ratioNo16 / 9Video aspect ratio.
classNamestringNoAdditional class for the container.
fallbacklink | compact | hiddenNolinkRendering used when no ID is supplied.