Arun Gopinath

Discover with Arun Gopinathan: Tech, Photography, and Everything in Between

How to add audio in hugo static site using a shortcode.

2020-04-03


This is a simple tutorial on how to add audio files in hugo static sites via shortcodes. Just follow these steps

STEP 1

Create a file audio.html in layouts/shortcodes folder.

STEP 2

Add following lines of code in the newly created audio.html file and save.

STEP 3

Save the required audio file in /static/xxx . For the demonstrative purpose I put the sample audio file in /static/posts/shortcodes/ (That’s where I put my static files for shortcode demonstrating articles). That’s all you are ready to go.

SONG: Stand By (#CWC19)

CREDITS: SME (on behalf of Black Butter); BMI - Broadcast Music Inc., UNIAO

ARTIST: LORYN