Embeds and media
Two components bring outside content into a page without hurting load time or reader privacy: wc-embed for video and iframes, and wc-github-repo for a repository card.
Embeds
wc-embed shows a video or any iframe with a fixed aspect ratio, so nothing shifts while it loads. It lazy-loads, and for YouTube, Vimeo and Loom it starts as a facade: a play button on a poster. Nothing is requested from the provider until the reader presses play, so the page sets no third-party cookies and loads no third-party scripts by itself.
Add a poster image of your own, such as poster="/assets/tour.webp", to put a picture behind the play button. A local poster keeps the facade free of any request to the video provider. YouTube embeds use the youtube-nocookie.com domain once playback starts.
Embed anything else
Any other URL is placed in a lazy-loaded iframe. Set the shape with ratio, or a fixed height:
Allowed ratios are written as width/height, such as 16/9 (the default), 4/3, 1/1 or 21/9.
Self-hosted video
A src that ends in .mp4, .webm, .ogv, .mov or .m4v plays in a native video element with controls:
Autoplay only works for muted video, and it is ignored for readers who prefer reduced motion. Set controls="false" to hide the controls.
Raw iframes and videos
You do not have to rewrite existing HTML. The build turns a raw <iframe> that points at YouTube, Vimeo or Loom into a wc-embed facade, and it adds loading="lazy" and a strict referrer policy to every other iframe. The importer does the same for iframe and video tags from Mintlify and Fern.
16/9, 4/3, 1/1 or 21/9.allow attribute, which sets the permissions policy.muted.false to hide the controls.GitHub repository cards
wc-github-repo shows a repository with its description, language, stars and forks. The card renders immediately from its attributes, with space reserved so nothing shifts, and then fills in live numbers from the public GitHub API. The result is cached in the browser for an hour. If the request fails, or the reader is offline, the card keeps what it has.
The flat variant drops the inset look. Add static values to override or replace what the API returns, and live="false" to never contact GitHub, which suits private docs and offline builds:
owner/name, or a full github.com URL.inset or flat.false to never call the GitHub API.For a star count in the header instead, see the github link type in Site chrome.
Next steps
- Style images, frames and zoom in Layout and Markdown basics
- Offer files with download links