| 1 |
--- |
| 2 |
title: Vimeo shortcode |
| 3 |
linkTitle: Vimeo |
| 4 |
description: Embed a Vimeo video in your content using the vimeo shortcode. |
| 5 |
categories: [] |
| 6 |
keywords: [] |
| 7 |
--- |
| 8 |
|
| 9 |
> [!NOTE] |
| 10 |
> To override Hugo's embedded `vimeo` shortcode, copy the [source code][] to a file with the same name in the `layouts/_shortcodes` directory. |
| 11 |
|
| 12 |
## Example |
| 13 |
|
| 14 |
To display a Vimeo video with this URL: |
| 15 |
|
| 16 |
```text |
| 17 |
https://vimeo.com/19899678 |
| 18 |
``` |
| 19 |
|
| 20 |
Include this in your Markdown: |
| 21 |
|
| 22 |
```md |
| 23 |
{{</* vimeo 19899678 */>}} |
| 24 |
``` |
| 25 |
|
| 26 |
Hugo renders this to: |
| 27 |
|
| 28 |
{{< vimeo 19899678 >}} |
| 29 |
|
| 30 |
## Arguments |
| 31 |
|
| 32 |
`id` |
| 33 |
: (string) The video `id`. Optional if the `id` is the first and only positional argument. |
| 34 |
|
| 35 |
`allowFullScreen` |
| 36 |
: {{< new-in 0.146.0 />}} |
| 37 |
: (`bool`) Whether the `iframe` element can activate full screen mode. Default is `true`. |
| 38 |
|
| 39 |
`class` |
| 40 |
: (`string`) The `class` attribute of the wrapping `div` element. Adding one or more CSS classes disables inline styling. |
| 41 |
|
| 42 |
`loading` |
| 43 |
: {{< new-in 0.146.0 />}} |
| 44 |
: (`string`) The loading attribute of the `iframe` element, either `eager` or `lazy`. Default is `eager`. |
| 45 |
|
| 46 |
`title` |
| 47 |
: (`string`) The `title` attribute of the `iframe` element. |
| 48 |
|
| 49 |
Here's an example using some of the available arguments: |
| 50 |
|
| 51 |
```md |
| 52 |
{{</* vimeo id=19899678 allowFullScreen=false loading=lazy */>}} |
| 53 |
``` |
| 54 |
|
| 55 |
## Privacy |
| 56 |
|
| 57 |
Adjust the relevant privacy settings in your project configuration. |
| 58 |
|
| 59 |
{{< code-toggle config=privacy.vimeo />}} |
| 60 |
|
| 61 |
`disable` |
| 62 |
: (`bool`) Whether to disable the shortcode. Default is `false`. |
| 63 |
|
| 64 |
`enableDNT` |
| 65 |
: (`bool`) Whether to block the Vimeo player from tracking session data and analytics. Default is `false`. |
| 66 |
|
| 67 |
`simple` |
| 68 |
: (`bool`) Whether to enable simple mode. If `true`, the video thumbnail is fetched from Vimeo and overlaid with a play button. Clicking the thumbnail opens the video in a new Vimeo tab. Default is `false`. |
| 69 |
|
| 70 |
The source code for the simple version of the shortcode is available [in this file][]. |
| 71 |
|
| 72 |
[in this file]: <{{% eturl vimeo_simple %}}> |
| 73 |
[source code]: <{{% eturl vimeo %}}> |