Embedding Shadertoy in Hugo Websites - Custom Hugo Shortcodes @WorldOfZeroDevelopment
Embedding Shadertoy in Hugo Websites - Custom Hugo Shortcodes  @WorldOfZeroDevelopment
Uploaded January 2020 | Updated November 2026, 1 day ago
Hugo Shortcodes are a way to use short snippets in your Hugo site that embed custom parameterized objects. Some built-in shortcodes can embed GitHub Gist code snippets, YouTube videos or Twitter posts. If Hugo does not provide a built-in shortcode for you however you'll need to create your own shortcode. Luckily, this is relatively straightforward.

Creating a custom shortcode begins by creating an `html` file in the `layouts/shortcodes` directory. The file should be named after the shortcode you'd like to create. For example `example.html` will create the `example` shortcode. Once you've created the file you can fill it with a combination of hugo's markup language and standard html. The markup language hugo provides allows you to access parameters or otherwise modify the behavior of the shortcode you're creating. In our case we'd like to embed a Shadertoy shader. Every shader on Shadertoy has a unique embed link based upon its ID so we can create a shortcode that accepts a shader id and plop the value into an iframe. Embed... done.

The source for the custom shader shortcode I use is in this gist: gist.github.com/runewake2/3f5d3b4827beefb56a66e9c228979820

Hugo is a really easy to use static website generation tool (gohugo.io/) that can turn your Markdown files into websites. Some documentation on custom Hugo shortcodes: gohugo.io/templates/shortcode-templates

Join the World of Zero Discord Server: discord.gg/hU5Kq2u
Embedding Shadertoy in Hugo Websites - Custom Hugo ShortcodesExploring MAUI - Multiplatform Apps Built With .NETColor Contrast Shader - Lets Make a Side Scrolling Shooter - Part 3Using AnimatedValues in Custom Unity EditorsI Built a Tool That Turns GitHub Contributions into Bookmarks Heres How It WorksBuilding Markdown Based Powerpoint Presentations with Remark.JSI See Game Objects - Unity Observer - Part 2Inline Initializing C# Dictionaries - Quick TipLive Coding a 3D Voxel Cube in UnitySetting Up A Minecraft ServerCreating our own Dockerized Mindustry ServerImporting .NET Libraries Into Unity 3D
World of Zero |

Embedding Shadertoy in Hugo Websites - Custom Hugo Shortcodes

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER