
* feat: move badge to a separate partial * feat: badge shortcode * docs: add badge shortcode examples * chore: generate css * docs: add spaces between badges
1.4 KiB
title | linkTitle | sidebar | ||
---|---|---|---|---|
Other Shortcodes | Others |
|
{{< callout emoji="ℹ️" >}} 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:
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" */>}}
Result:
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" >}}
YouTube
Embed a YouTube video.
{{</* youtube VIDEO_ID */>}}
Result:
{{< youtube id=dQw4w9WgXcQ loading=lazy >}}
For more information, see Hugo's YouTube Shortcode.
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" >}}