Include

The include shortcode includes other files from your project inside of the current page.

Usage

While the examples are using named parameter you are free to use positional aswell.

{{% include file="shortcodes/INCLUDE_ME.md" %}}
{{% include "shortcodes/INCLUDE_ME.md" %}}

The included files can even contain Markdown and will be taken into account when generating the table of contents.

Parameter

Name Position Default Notes
file 1 <empty> The path to the file to be included. Path resolution adheres to Hugo’s build-in readFile function
showfirstheading 2 true When false and the included file contains headings, the first heading will be hidden. This comes in handy, eg. if you include otherwise standalone Markdown files.

Examples

Arbitray Content

{{% include "shortcodes/INCLUDE_ME.md" %}}

You can add standard markdown syntax:

  • multiple paragraphs
  • bullet point lists
  • emphasized, bold and even bold emphasized text
  • links
  • etc.
...and even source code

the possiblities are endless (almost - including other shortcodes may or may not work) (almost - including other shortcodes may or may not work)