2024-08-18 16:34:48 +01:00
|
|
|
|
---
|
|
|
|
|
title: Other Shortcodes
|
|
|
|
|
linkTitle: Others
|
|
|
|
|
sidebar:
|
|
|
|
|
exclude: true
|
2025-03-29 12:51:42 +00:00
|
|
|
|
next: /docs/guide/deploy-site
|
2024-08-18 16:34:48 +01:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
{{< callout emoji="ℹ️" >}}
|
|
|
|
|
Some of these are Hugo built-in shortcodes.
|
|
|
|
|
These shortcodes are considered less stable and may be changed anytime.
|
|
|
|
|
{{< /callout >}}
|
|
|
|
|
|
2024-09-22 22:12:22 +01:00
|
|
|
|
## 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" >}}
|
|
|
|
|
|
2024-12-28 13:50:22 +00:00
|
|
|
|
With link and icon:
|
2024-09-22 22:12:22 +01:00
|
|
|
|
|
|
|
|
|
```
|
2024-12-28 13:50:22 +00:00
|
|
|
|
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
|
2024-09-22 22:12:22 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
|
|
2024-12-28 13:50:22 +00:00
|
|
|
|
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}
|
2024-09-22 22:12:22 +01:00
|
|
|
|
|
2024-08-18 16:34:48 +01:00
|
|
|
|
## YouTube
|
|
|
|
|
|
|
|
|
|
Embed a YouTube video.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
{{</* youtube VIDEO_ID */>}}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
|
|
|
|
|
|
{{< youtube id=dQw4w9WgXcQ loading=lazy >}}
|
|
|
|
|
|
|
|
|
|
For more information, see [Hugo's YouTube Shortcode](https://gohugo.io/content-management/shortcodes/#youtube).
|
|
|
|
|
|
|
|
|
|
## 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" >}}
|