Embed YouTube video

I want to know how to embed an online YouTube video. Basically I’m creating website with movies’ information. So I wanted their trailers. How to embed in

Hugo has a feature called shortcodes. With them you can write small scripts for repeated use in content files. There are also some built-in, for YouTube too. You can find a descrition about their usage here in the docs.

If your video link is:

{{< youtube w7Ft2ymGmfc >}}

Thanks guys.

Hi there, the above works fine for me, but there is a bug when the id has an underscore (_) like this video:
Any suggestions?

It works for me so can’t comment on how to fix it. Have you tried using the id shortcode parameter? Perhaps that might make a difference:

{{< youtube id="CMtN_LUpeLg" >}}

A post was split to a new topic: Please help me with GDPR and YouTube