summaryrefslogtreecommitdiffstats
path: root/docs/content/en/shortcodes/vimeo.md
blob: 1164ce997789f3c2cea61fe43c358f0ef0538542 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: Vimeo shortcode
linkTitle: Vimeo
description: Embed a Vimeo video in your content using the vimeo shortcode.
categories: []
keywords: []
---

> [!note]
> 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:

```text
https://vimeo.com/channels/staffpicks/55073825
```

Include this in your Markdown:

```text
{{</* vimeo 55073825 */>}}
```

Hugo renders this to:

{{< vimeo 55073825 >}}

## Arguments

id
: (string) The video `id`. Optional if the `id` is provided as a positional argument as shown in the example above.

allowFullScreen
: {{< new-in 0.146.0 />}}
: (`bool`) Whether the `iframe` element can activate full screen mode. Default is `true`.

class
: (`string`) The `class` attribute of the wrapping `div` element. Adding one or more CSS classes disables inline styling.

loading
: {{< new-in 0.146.0 />}}
: (`string`) The loading attribute of the `iframe` element, either `eager` or `lazy`. Default is `eager`.

title
: (`string`) The `title` attribute of the `iframe` element.

Here's an example using some of the available arguments:

```text
{{</* vimeo id=55073825 allowFullScreen=false loading=lazy */>}}
```

## Privacy

Adjust the relevant privacy settings in your site configuration.

{{< code-toggle config=privacy.vimeo />}}

disable
: (`bool`) Whether to disable the shortcode. Default is `false`.

enableDNT
: (`bool`) Whether to block the Vimeo player from tracking session data and analytics. Default is `false`.

simple
: (`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`.

The source code for the simple version of the shortcode is available [here].

[here]: {{% eturl vimeo_simple %}}
[source code]: {{% eturl vimeo %}}