Hugo provides a set of embedded shortcodes to help you add rich content to your Markdown files without writing raw HTML. These shortcodes work out-of-the-box.
YouTube
Embed a YouTube video by providing the video ID (Hint: The video ID is the string after v= in the YouTube URL).
Example: For video https://www.youtube.com/watch?v=w7Ft2ymGmfc
{{< youtube w7Ft2ymGmfc >}}Output
Check hugo | shortcodes | youtube for more details.
Vimeo
Embed a Vimeo video by providing the video ID (Hint: The video ID is the string of numbers at the end of the Vimeo URL).
Example : For video https://vimeo.com/146022717?fl=pl&fe=vl
{{/* */}}
{{< vimeo 146022717 >}}Output
Check hugo | shortcodes | vimeo for more details.
X (Tweet)
Embed a tweet by providing the username and tweet ID (Hint: The tweet ID is the long number at the end of the tweet URL).
Note: The
tweetshortcode might require privacy settings adjustments depending on the user’s browser context.
Example : For tweet https://twitter.com/SanDiegoZoo/status/1453110110599868418
{{< x user="SanDiegoZoo" id="1453110110599868418" >}}Output
Owl bet you'll lose this staring contest 🦉 pic.twitter.com/eJh4f2zncC
— San Diego Zoo Wildlife Alliance (@sandiegozoo) October 26, 2021
Check hugo | shortcodes | x for more details.
Embed an Instagram post.
Example: for post https://www.instagram.com/p/CJMFOb3jkrT/
{{< instagram CJMFOb3jkrT >}}Output
Check hugo | shortcodes | instagram for more details.