Skip to content

Shortcodes

Lukas Joswiak edited this page Jun 8, 2020 · 3 revisions

Shortcodes are small snippets that can be added inside Markdown files to create predefined output. See the Hugo documentation on shortcodes for more info.

Etch supports built-in Hugo shortcodes and adds additional, custom shortcodes. The table below lists custom shortcodes added to Etch. It also lists built-in shortcodes that have been explicitly tested to ensure compatibility.

Name Type Description Example
toc custom Adds a table of contents. Headings are generated based on header elements in the file. Configurable based on the table of contents markup configuration. {{< toc >}}
figure built-in More semantic way to insert an image. Can specify more options, such as a title and a caption. See all the options in the Hugo documentation. I recommend using this shortcode when adding images to your Markdown. {{< figure src="/img/image.png" title="Image Title" caption="Image caption" alt="Alt text" >}}
Clone this wiki locally