jekyll-bunny 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +97 -0
- data/lib/jekyll/bunny_tag.rb +66 -0
- data/lib/jekyll-bunny.rb +3 -0
- metadata +66 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d186ed6a7c9f585101a694e39553088a20aa2658380821c978d74edcf6b658e9
|
|
4
|
+
data.tar.gz: dc682446a6dc4ce19bc34171990c792f9b40f717ec383f1212d37bea66cdced5
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8b9214cdd2638915a0624042d507b346438380ccf082f94d49639777daafbc5984325e1126dade8107748b4f122b634d28aca3b4aec81d002c121dca343a3e9a
|
|
7
|
+
data.tar.gz: 1616bf710529c9169b46372b55b8e1b2ae1e4e1d5f6c551493a826ebd8273e5f7fc80e62af373fc70a20c88b0cb7e7fc9fdef59f15a9e05996cefb2658863aec
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] - 2026-08-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Initial release
|
|
7
|
+
- `{% bunny LIBRARY_ID VIDEO_ID %}` Liquid tag for embedding Bunny Stream videos
|
|
8
|
+
- Responsive 16:9 iframe wrapper with class `bunny-embed`
|
|
9
|
+
- Support for Bunny Stream embed parameters: `autoplay`, `loop`, `muted`, `preload`, `t`, `chromecast`, `disableAirplay`, `disableIosPlayer`, `showHeatmap`, `playsinline`, `showSpeed`, `rememberPosition`, `compactControls`, `responsive`, `captions`
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jason Chance
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# jekyll-bunny
|
|
2
|
+
|
|
3
|
+
A Jekyll plugin that provides a `{% bunny %}` Liquid tag for embedding [Bunny Stream](https://bunny.net/stream/)-hosted videos with a responsive iframe wrapper.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add to your `Gemfile`:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem "jekyll-bunny", "~> 0.1"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Add to your `_config.yml`:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
plugins:
|
|
17
|
+
- jekyll-bunny
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Then run:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
bundle install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
The tag requires both your **Library ID** and **Video ID**:
|
|
29
|
+
|
|
30
|
+
```liquid
|
|
31
|
+
{% bunny LIBRARY_ID VIDEO_ID %}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
With optional parameters:
|
|
35
|
+
|
|
36
|
+
```liquid
|
|
37
|
+
{% bunny LIBRARY_ID VIDEO_ID autoplay=false loop=true muted=false showSpeed=true %}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The tag outputs a responsive 16:9 iframe wrapper:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<div class="bunny-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
44
|
+
<iframe
|
|
45
|
+
src="https://player.mediadelivery.net/embed/LIBRARY_ID/VIDEO_ID"
|
|
46
|
+
frameborder="0"
|
|
47
|
+
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture"
|
|
48
|
+
allowfullscreen
|
|
49
|
+
style="position:absolute;top:0;left:0;width:100%;height:100%;"
|
|
50
|
+
loading="lazy">
|
|
51
|
+
</iframe>
|
|
52
|
+
</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Finding Your Library ID and Video ID
|
|
56
|
+
|
|
57
|
+
Both values are available in your Bunny Stream dashboard. The embed URL format is:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
https://player.mediadelivery.net/embed/{LIBRARY_ID}/{VIDEO_ID}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
You can also copy the embed code from the video details page in the Bunny Stream dashboard.
|
|
64
|
+
|
|
65
|
+
## Supported Parameters
|
|
66
|
+
|
|
67
|
+
| Parameter | Values | Description |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| `autoplay` | `true`, `false` | Autoplay on load (may be blocked by browsers) |
|
|
70
|
+
| `loop` | `true`, `false` | Loop playback |
|
|
71
|
+
| `muted` | `true`, `false` | Start muted |
|
|
72
|
+
| `preload` | `true`, `false` | Preload video files |
|
|
73
|
+
| `playsinline` | `true`, `false` | Play inline on mobile |
|
|
74
|
+
| `t` | `30s`, `1h20m45s`, `hh:mm:ss`, or seconds | Start playback at this time |
|
|
75
|
+
| `captions` | caption short-code | Default caption language (e.g., `en`) |
|
|
76
|
+
| `chromecast` | `true`, `false` | Enable Chromecast support |
|
|
77
|
+
| `disableAirplay` | `true`, `false` | Disable AirPlay |
|
|
78
|
+
| `disableIosPlayer` | `true`, `false` | Disable native iOS player |
|
|
79
|
+
| `showHeatmap` | `true`, `false` | Show engagement heatmap on progress bar |
|
|
80
|
+
| `showSpeed` | `true`, `false` | Show playback speed control |
|
|
81
|
+
| `rememberPosition` | `true`, `false` | Remember last playback position |
|
|
82
|
+
| `compactControls` | `true`, `false` | Enable compact player UI |
|
|
83
|
+
| `responsive` | `true`, `false` | Responsive player sizing |
|
|
84
|
+
|
|
85
|
+
## Styling
|
|
86
|
+
|
|
87
|
+
The plugin outputs an unstyled `.bunny-embed` wrapper div. Add bottom margin or other spacing in your site's CSS:
|
|
88
|
+
|
|
89
|
+
```css
|
|
90
|
+
.bunny-embed {
|
|
91
|
+
margin-bottom: 2rem;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT — see [LICENSE.txt](LICENSE.txt).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "cgi"
|
|
4
|
+
require "liquid"
|
|
5
|
+
|
|
6
|
+
module Jekyll
|
|
7
|
+
class BunnyTag < Liquid::Tag
|
|
8
|
+
EMBED_BASE = "https://player.mediadelivery.net/embed/"
|
|
9
|
+
|
|
10
|
+
# Supported query parameters for the Bunny Stream iframe embed player.
|
|
11
|
+
# See: https://docs.bunny.net/docs/stream-embedding-videos
|
|
12
|
+
VALID_PARAMS = %w[
|
|
13
|
+
autoplay captions preload t chromecast disableAirplay disableIosPlayer
|
|
14
|
+
showHeatmap muted loop playsinline showSpeed rememberPosition
|
|
15
|
+
compactControls responsive
|
|
16
|
+
].freeze
|
|
17
|
+
|
|
18
|
+
def initialize(tag_name, markup, tokens)
|
|
19
|
+
super
|
|
20
|
+
parts = markup.strip.split(/\s+/, 3)
|
|
21
|
+
@library_id = parts[0]
|
|
22
|
+
@video_id = parts[1]
|
|
23
|
+
@params = parse_params(parts[2] || "")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def render(_context)
|
|
27
|
+
raise "Bunny tag requires a library ID" if @library_id.nil? || @library_id.strip.empty?
|
|
28
|
+
raise "Bunny tag requires a video ID" if @video_id.nil? || @video_id.strip.empty?
|
|
29
|
+
|
|
30
|
+
src = "#{EMBED_BASE}#{@library_id}/#{@video_id}"
|
|
31
|
+
unless @params.empty?
|
|
32
|
+
src += "?" + @params.map { |k, v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}" }.join("&")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
<<~HTML.strip
|
|
36
|
+
<div class="bunny-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
37
|
+
<iframe
|
|
38
|
+
src="#{src}"
|
|
39
|
+
frameborder="0"
|
|
40
|
+
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture"
|
|
41
|
+
allowfullscreen
|
|
42
|
+
style="position:absolute;top:0;left:0;width:100%;height:100%;"
|
|
43
|
+
loading="lazy">
|
|
44
|
+
</iframe>
|
|
45
|
+
</div>
|
|
46
|
+
HTML
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
def parse_params(raw)
|
|
52
|
+
params = {}
|
|
53
|
+
raw.scan(/(\S+?)=(?:"([^"]*?)"|'([^']*?)'|(\S+))/) do |key, dq, sq, bare|
|
|
54
|
+
value = dq || sq || bare
|
|
55
|
+
if VALID_PARAMS.include?(key)
|
|
56
|
+
params[key] = value
|
|
57
|
+
else
|
|
58
|
+
warn "jekyll-bunny: Unknown param '#{key}' ignored"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
params
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Liquid::Template.register_tag("bunny", Jekyll::BunnyTag)
|
data/lib/jekyll-bunny.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-bunny
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jason Chance
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2026-08-20 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: jekyll
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '4.0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '4.0'
|
|
26
|
+
description: jekyll-bunny provides a simple {% bunny LIBRARY_ID VIDEO_ID %} Liquid
|
|
27
|
+
tag for embedding Bunny Stream videos with a responsive iframe wrapper and support
|
|
28
|
+
for Bunny Stream embed parameters.
|
|
29
|
+
email:
|
|
30
|
+
- jason@jasonchance.com
|
|
31
|
+
executables: []
|
|
32
|
+
extensions: []
|
|
33
|
+
extra_rdoc_files: []
|
|
34
|
+
files:
|
|
35
|
+
- CHANGELOG.md
|
|
36
|
+
- LICENSE.txt
|
|
37
|
+
- README.md
|
|
38
|
+
- lib/jekyll-bunny.rb
|
|
39
|
+
- lib/jekyll/bunny_tag.rb
|
|
40
|
+
homepage: https://jasonchance.com/projects/jekyll-bunny/
|
|
41
|
+
licenses:
|
|
42
|
+
- MIT
|
|
43
|
+
metadata:
|
|
44
|
+
homepage_uri: https://jasonchance.com/projects/jekyll-bunny/
|
|
45
|
+
source_code_uri: https://github.com/jchance/jekyll-bunny
|
|
46
|
+
bug_tracker_uri: https://github.com/jchance/jekyll-bunny/issues
|
|
47
|
+
changelog_uri: https://github.com/jchance/jekyll-bunny/blob/main/CHANGELOG.md
|
|
48
|
+
rdoc_options: []
|
|
49
|
+
require_paths:
|
|
50
|
+
- lib
|
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '3.0'
|
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
requirements: []
|
|
62
|
+
rubygems_version: 3.6.2
|
|
63
|
+
specification_version: 4
|
|
64
|
+
summary: A Jekyll plugin that provides a {% bunny %} Liquid tag for embedding Bunny
|
|
65
|
+
Stream videos.
|
|
66
|
+
test_files: []
|