Shortcodes #
Shortcodes are user-facing components that content authors can use directly within markdown files. They provide a simple way to embed complex HTML snippets without writing raw HTML.
Key Characteristics:
- Used in markdown content files (
.md) - Simple syntax:
{{< shortcode-name param >}} - Perfect for content authors who want to enhance their markdown
- Located in
layouts/shortcodes/(orlayouts/_shortcodes/in themes)
Example:
markdown
Check out my GitHub profile: {{< icon "github" "brands" >}}Partials #
Partials are developer-facing template components used within Hugo layouts and other templates. They’re the building blocks for theme developers.
Key Characteristics:
- Used in template files (
.html) - Called with:
{{ partial "name.html" context }} - Used by theme developers to build layouts
- Located in
layouts/partials/(orlayouts/_partials/in themes)
Example:
go-html-template
{{ partial "widgets/breadcrumb.html" (dict "page" . "site" .Site) }}