-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b7b779
commit 381d44c
Showing
6 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
+++ | ||
title = "Video" | ||
date = 2023-06-04 | ||
[taxonomies] | ||
categories = ["media"] | ||
tags = ["content", "shortcode"] | ||
[extra] | ||
subtitle = "Shortcodes for videos" | ||
+++ | ||
|
||
## Vimeo | ||
|
||
input: | ||
|
||
```rs | ||
{{/* vimeo(id="4340383") */}} | ||
``` | ||
|
||
- `id`: the video id (mandatory) | ||
- `autoplay`: when set to "true", the video autoplays on load (optional) | ||
- `loop`: when set to "true", the video plays on a loop (optional) | ||
- `noautopause`: when set to "true", the video will not autopause (optional) | ||
- `title` - set alt title for the iframe (optional, defaults to "Vimeo") | ||
- `cookie` - set to "true" if you want tracking cookies, otherwise it defaults to false. | ||
|
||
output: | ||
|
||
```html | ||
{{ vimeo(id="4340383") }} | ||
``` | ||
{{ vimeo(id="4340383") }} | ||
|
||
## YouTube | ||
|
||
input: | ||
|
||
```rs | ||
{{/* youtube(id="frBzlP6t9Gw") */}} | ||
``` | ||
|
||
- `id`: the video id (mandatory) | ||
- `playlist`: the playlist id (optional) | ||
- `autoplay`: when set to "true", the video autoplays on load (optional) | ||
- `title` - set alt title for the iframe (optional, defaults to "Youtube") | ||
- `cookie` - set to "true" if you want tracking cookies, otherwise it defaults to false. | ||
|
||
output: | ||
|
||
```html | ||
{{ youtube(id="frBzlP6t9Gw") }} | ||
``` | ||
{{ youtube(id="frBzlP6t9Gw") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="video-embedded"> | ||
<video height="520" {% if autoplay %}autoplay{% endif %} {% if controls %}controls{% endif %}> | ||
<source src="{{ src }}" type="{{ 'video/' ~ type }}"> | ||
</video> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="video-embedded"> | ||
<iframe | ||
src="https://player.vimeo.com/video/{{id}}?embedded=true{% if autoplay %}&autoplay=1{% endif %}{% if loop %}&loop=1{% endif %}{% if noautopause %}&autopause=0{% endif %}{% if not cookie %}&dnt=1{% endif %}" | ||
class="video-iframe" | ||
title="{{ title | default(value='Vimeo') }}" | ||
webkitallowfullscreen | ||
mozallowfullscreen | ||
allowfullscreen> | ||
</iframe> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="video-embedded"> | ||
<iframe | ||
src="https://www.youtube{% if not cookie %}-nocookie{% endif %}.com/embed/{{ id }}{% if autoplay %}?autoplay=1{% endif %}" | ||
class="video-iframe" | ||
webkitallowfullscreen | ||
mozallowfullscreen | ||
allowfullscreen> | ||
</iframe> | ||
</div> |