Hugo shortcode for embedding Unity WebGL players – updated with code

02 July 2021 webdev gamedev

Want to embed Unity WebGL players easily inside your Hugo website? Here’s a shortcode for you.

I wanted to embed my Unity WebGL builds inside this site, rather than linking to the content in a new tab (which is over in Azure blob storage). This lets me do that.


Code is available here:

Example usage

{{< unity-webgl-player 
    gameTitle="My cool game"
    playerID=""  >}}


Embedding the first ever game I made:

This content does not resize on smaller browser widths. Try using the fullscreen button below (after loading the game).
WebGL builds are not supported on mobile devices.

I hope this helps someone!

Issues/comments/improvements/etc welcome 😄

comments powered by Disqus