Code Snippet: Including Shiny Apps in Your Static Website with Hugo

code-snippet hugo shiny R

Since cross-domain resizing is non-trivial, I wrote the following shortcode that takes the name of your app as its first argument and the number of vertical pixels as its second argument.

<!--shiny.html-->
<iframe src="https://conradborchers.shinyapps.io/{{ index .Params 0 }}/"
        style="height:{{ index .Params 1 }}px;width:100%;border:none;overflow:hidden;" scrolling="no"></iframe>

For each app, adjust the second argument until the whole app is displayed and ta-da! you have an interactive app displayed in your static site.

Example use, remove space between “{{” and “}}”

{ {< shiny appname 800 >} }

Questions? Thoughts? Generate a Comment to this Post!


Enter Name:


Enter a Title for Later Reference:


If Applicable, Enter Reply Reference:


Enter Comment:



JS Code to Create and Format Comments in Static Websites like Hugo

hugo js

Code to automatically generate a search bar in JS from XML page content in Hugo

hugo js r

Permutation Test for F-score Differences in Python

code-snippet python stats

Search this Website