Include

Th' include shortcode includes other files from yer project inside o' th' current plank.

Usage

While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional aswell or also call this shortcode from yer own partials.

{{% include file="shortcodes/INCLUDE_ME.md" %}}
{{% include "shortcodes/INCLUDE_ME.md" %}}
{{ partial "shortcodes/include .html" (dict
  "page" .
  "file" "shortcodes/INCLUDE_ME.md"
)}}

Th' included files can even contain Marrrkdown an' will be taken into account when generat'n th' t'ble o' contents.

Parameter

Name Posit'n Default Notes
file 1 <empty> Th' path t' th' file t' be included. Path resolut'n adheres t' Hugo’s build-in readFile funct'n
hidefirsthead'n 2 false When true an' th' included file contains head'ns, th' first head'n will be hidden. This comes 'n handy, eg. if ye include otherwise standalone Marrrkdown files.

Examples

Arbitrary Rrrambl'n

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

Ye can add standard markdown rules:

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

th' possibilities be endless (almost - includ'n other shorrrtcodes may or may not work) (almost - includ'n other shorrrtcodes may or may not work)


  1. Et Cetera (English: /ɛtˈsɛtərə/), abbreviated t' etc., etc, et cet., be a Latin expression that be used 'n English t' mean “and other similar things”, or “and so forth” ↩︎