Embedding Runkit in Hugo

Hello everyone, I’m working upon my Hugo blog where I want to embed the runkit, in HTML I could simply do that by embedding,

<script src="https://embed.runkit.com" data-element-id="my-element"></script>
<div id="my-element">
console.log('Hello');
</div>

I just wanna know how can I provide the content dynamically from my Hugo markdown blogs? i.e the console.log above has to be mine from blog markdown post.

Thank you!

2 possible ways:

  • create embed programmatically.
  • embed a runkit notebook (oembed)

https://runkit.com/docs/embed#code

Maybe the web component I created will help you: https://github.com/tpluscode/wc-runkit

I’ve been using this on documentation pages written in markdown as presented in the readme