Files
hextra_mirror/exampleSite/content/docs/guide/shortcodes/others.md
Ludovic Fernandez f4d75a4e5b feat(callout): revamp of the callouts (#767)
* feat(callout): revamp of the callouts

* fix: doc

* chore: refactor gh alert

* feat: same colors on callouts and gh alerts

* docs: more relevant examples

* docs: i18n

* docs: update existing callouts
2025-08-21 23:31:16 +01:00

2.0 KiB

title, linkTitle, sidebar, next
title linkTitle sidebar next
Other Shortcodes Others
exclude
true
/docs/guide/deploy-site

{{< callout type="warning" >}} Some of these are Hugo built-in shortcodes. These shortcodes are considered less stable and may be changed anytime. {{< /callout >}}

Badge

{{</* badge "Badge" */>}}

Result:

{{< badge "Badge" >}}

Variants:

{{</* badge content="info" type="info" */>}}
{{</* badge content="warning" type="warning" */>}}
{{</* badge content="error" type="error" */>}}

Result:

{{< badge content="info" type="info" >}}   {{< badge content="warning" type="warning" >}}   {{< badge content="error" type="error" >}}

With link and icon:

{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}

Result:

{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}

Options

Name Description
content The text of the badge.
link The link of the badge.
icon The icon of the badge.
type The type of the badge. (default, info, warning, error)
class The class of the badge.

YouTube

Embed a YouTube video.

{{</* youtube VIDEO_ID */>}}

Result:

{{< youtube id=dQw4w9WgXcQ loading=lazy >}}

For more information, see Hugo's YouTube Shortcode.

PDF

With PDF shortcode, you can embed a PDF file in your content.

{{</* pdf "https://example.com/sample.pdf" */>}}

You can also place the PDF file in your project directory and use the relative path.

{{</* pdf "path/to/file.pdf" */>}}

Example:

{{< pdf "https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf" >}}