How to use Speakerdeck embeds

I need to embed my presentations on a Hugo (0.66) site. However the builtin Speakerdeck support was removed in 0.42

What is the best way to proceed ?

  • Work with a custom Hugo build, in which I’ll have to apply a patch on each release to support the feature ? Seems no-so-practical
  • Add a frontmatter key which the site them will know to fetch and generate the script tag if found ? That’s what I did in the short term, but it’s not very convenient.
  • Pass the whole content through safeJS ? Seems dangerous.
  • Submit a new version of the Speakerdeck shortcode addressing the issues in #4830 ?

You simply create a Speakerdeck shortcode in your project.

safeJS tells the go-txt package that it is safe to process an inline JS script and it takes place before output formats are rendered by Hugo. It certainly is not dangerous.

1 Like

Just realized shortcodes were available per-site and did not need to be compiled in, but you already answered. This is indeed the best solution.

This topic was automatically closed after 5 hours. New replies are no longer allowed.