Hugo Shortcodes

Hugo shortcodes include relatively complicated HTML in your Markdown document. Some examples:

  • YouTube
  • Twitter
  • Instagram
  • Notes and Warnings
  • GitHub gists.

Adding a YouTube video

{ {% youtube 2WTWx0yknQQ %} }

Note: no spaces between the braces!


Adding a tweet

{ {% tweet 817461069014859780 %} }

Note: no spaces between the braces!


Adding Instagram

{ {% instagram BWNjjyYFxVx hidecaption %} }

Note: no spaces between the braces!


Add a note or a warning

{ {% alert note %} }

Here’s a tip or note…

{ {% /alert %} }

Here’s a tip or note…

{ {% alert warning %} }

Don’t try this at home!

{ {% /alert %} }

Don’t try this at home!


Add a GitHub gist:

Suppose that we want to include the gist at the following URL:

https://gist.github.com/spf13/7896402

We can use:

{ {% gist spf13 7896402 %} }


Avatar
Pierre Hoonhout
Associate Professor in Econometrics

My research interests include panel data, panel data attrition, missing data, causal inference, policy evaluation, response based sampling and reproducible research using R and Stata.