Skip to main content

How to embed a YouTube video in a docusaurus blog article

· One min read
Andrew Golightly

Embedding a YouTube video in a Docusaurus blog article is actually very easy to do. I just couldn't find any docs on it. This is how to do it.

It basically involves getting the iframe code from YouTube for the video, and pasting it directly into the article.

  1. Visit the YouTube video in a browser. e.g. https://www.youtube.com/watch?v=8OGpz0UeYp4
  2. Click the share button

share button

  1. Click the embed button

embed button

  1. Copy the iframe code

iframe code

  1. Paste in the iframe code into the article where you want the video to appear. Change the width value to "100%"; this will make the video span the full width of the page, and make it responsive for smaller screens.

paste iframe code

All done!