Vimeo shortcode
Embed a Vimeo video in your content using the vimeo shortcode.
To override Hugo’s embedded vimeo
shortcode, copy the source code to a file with the same name in the layouts/shortcodes
directory.
Example
To display a Vimeo video with this URL:
https://vimeo.com/channels/staffpicks/55073825
Include this in your Markdown:
{{< vimeo 55073825 >}}
Hugo renders this to:
Arguments
- id
- (string) The video
id
. Optional if theid
is provided as a positional argument as shown in the example above. - allowFullScreen
- New in v0.146.0
- (
bool
) Whether theiframe
element can activate full screen mode. Default istrue
. - class
- (
string
) Theclass
attribute of the wrappingdiv
element. Adding one or more CSS classes disables inline styling. - loading
- New in v0.146.0
- (
string
) The loading attribute of theiframe
element, eithereager
orlazy
. Default iseager
. - title
- (
string
) Thetitle
attribute of theiframe
element.
Here’s an example using some of the available arguments:
{{< vimeo id=55073825 allowFullScreen=false loading=lazy >}}
Privacy
Adjust the relevant privacy settings in your site configuration.
privacy:
vimeo:
disable: false
enableDNT: false
simple: false
[privacy]
[privacy.vimeo]
disable = false
enableDNT = false
simple = false
{
"privacy": {
"vimeo": {
"disable": false,
"enableDNT": false,
"simple": false
}
}
}
- disable
- (
bool
) Whether to disable the shortcode. Default isfalse
. - enableDNT
- (
bool
) Whether to block the Vimeo player from tracking session data and analytics. Default isfalse
. - simple
- (
bool
) Whether to enable simple mode. Iftrue
, 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 isfalse
.
The source code for the simple version of the shortcode is available here.
Last updated:
March 9, 2025
:
content: Miscellaneous updates related to v0.146.0 (195b368e8)
Improve this page