Hugo is a static site generator that can use Markdown as a content format. But sometimes Markdown falls short and one might want to add raw HTML to the content. This contradicts Markdown's simplicity. Hugo created shortcodes as way to add HTML snippets in a Markdown manner.
Just copy the HTML file corresponding to the listed shortcode into one of the following directory.
/layouts/shortcodes/
or
/themes/<THEME>/layouts/shortcodes/
The following shortcodes come with zero dependencies and can be used independently from each other.
Takes a SVG file and replaces the color #ff7870
and replaces it with another color.
{{< fingernail "fingernail.svg" "Bright Red" "#e33034" >}}
Allows to embedded documents (e.g. pdf files) into the page.
{{< iframe "manual.pdf#toolbar=0" >}}
Allows to create simple muliple-choice quizes. After each question, the possible answers follow. ( )
indicates that only one correct answer exists. This will be rendered to a radio element. [ ]
indicates that multiple answers are correct. This will be rendered to a checkbox element. space
between the brackets mark incorrect answers, X
mark correct answers.
A question-and-answer block has to be seperated with an empty line.
{{< quiz >}}
How is the weather today?
(X) sunny
( ) cloudy
( ) rainy
What seasons exists?
[X] spring
[X] summer
[X] fall
[ ] apple tree
[X] winter
{{< /quiz >}}
Embedds a video.
{{< video "big-buck-bunny.mp4" >}}