jekyll-livid 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/CONTRIBUTING.md +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +141 -0
- data/lib/jekyll/livid_tag.rb +66 -0
- data/lib/jekyll-livid.rb +4 -0
- metadata +65 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0216c276b3b0843b9ce7a12d52d53a7989d52fbbd46dbd962b54ddece1f74cc9
|
|
4
|
+
data.tar.gz: 9e1936ee63036cf826132070cb131c89dc56ff8f7095ca5c812aeacd45e7d897
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 6bd03db1a5d593d0bed26b524f4315a3d87113dbe650727625a883b2b007ffb8cdcdfb33557c4974aed67ef1dfa229117aa9778e9b6740a236d759f06aae0591
|
|
7
|
+
data.tar.gz: 8493a2dad67d78e96266e5f716dea5daae15164d1b0cc99b8489b5e6aaf7c934fafff8f2dc0bfd1bda666d698ea87260e51794919ca97ce75710073482cfd048
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Initial release
|
|
6
|
+
- `{% livid VIDEO_ID %}` tag with responsive 16:9 iframe wrapper
|
|
7
|
+
- Full support for all Livid advanced embedding parameters
|
|
8
|
+
- `#t=` hash fragment support for timestamp start
|
|
9
|
+
- Unknown parameter warnings via Jekyll logger
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving `jekyll-livid`.
|
|
4
|
+
|
|
5
|
+
## Before submitting changes
|
|
6
|
+
|
|
7
|
+
1. Keep the scope narrow and focused on Livid video embedding.
|
|
8
|
+
2. Add or update tests for behavior changes.
|
|
9
|
+
3. Run the test suite before opening a pull request.
|
|
10
|
+
|
|
11
|
+
## Local development
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bundle install
|
|
15
|
+
ruby -Ilib -Itest test/livid_tag_test.rb
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Design philosophy
|
|
19
|
+
|
|
20
|
+
- One tag, one job: embed Livid videos cleanly
|
|
21
|
+
- All advanced parameters passed through to the iframe src
|
|
22
|
+
- No dependencies beyond Jekyll itself
|
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,141 @@
|
|
|
1
|
+
# jekyll-livid
|
|
2
|
+
|
|
3
|
+
A Jekyll plugin that provides a `{% livid %}` Liquid tag for embedding [Livid](https://livid.com)-hosted videos with a responsive iframe wrapper and full support for [advanced embedding parameters](https://support.livid.com/article/46-advanced-embedding-parameters).
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
This plugin is intentionally narrow. It handles one thing: embedding Livid videos cleanly in Jekyll templates with a minimal, standards-compliant iframe output.
|
|
8
|
+
|
|
9
|
+
## Who this is for
|
|
10
|
+
|
|
11
|
+
- Jekyll site owners who host video on Livid
|
|
12
|
+
- Anyone migrating from Vimeo to Livid who wants drop-in embed support
|
|
13
|
+
- Developers who want fine-grained control over player behavior via URL parameters
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- `{% livid VIDEO_ID %}` tag with responsive 16:9 iframe wrapper
|
|
18
|
+
- Full support for all [Livid advanced embedding parameters](https://support.livid.com/article/46-advanced-embedding-parameters)
|
|
19
|
+
- `#t=` hash fragment support for timestamp-based start positions
|
|
20
|
+
- Unknown parameter warnings via Jekyll logger (skipped silently in output)
|
|
21
|
+
- Lazy-loading iframe by default
|
|
22
|
+
|
|
23
|
+
## GitHub Pages compatibility
|
|
24
|
+
|
|
25
|
+
This plugin is compatible with Jekyll sites deployed to GitHub Pages **when the site is built through a custom GitHub Actions workflow**.
|
|
26
|
+
|
|
27
|
+
It is **not** compatible with the default GitHub Pages safe-mode build, which does not load custom plugins.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Published on RubyGems:
|
|
32
|
+
|
|
33
|
+
- https://rubygems.org/gems/jekyll-livid
|
|
34
|
+
|
|
35
|
+
Add the gem to your `Gemfile`:
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
38
|
+
gem "jekyll-livid", "~> 0.1.0"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then add it to `_config.yml`:
|
|
42
|
+
|
|
43
|
+
```yml
|
|
44
|
+
plugins:
|
|
45
|
+
- jekyll-livid
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bundle install
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Styling
|
|
55
|
+
|
|
56
|
+
The plugin outputs a wrapper `div` with the class `livid-embed`. No spacing or layout styles are applied — this is intentional, since every site has its own typographic rhythm and spacing scale.
|
|
57
|
+
|
|
58
|
+
If the embed sits too close to the content below it, add a rule to your site's CSS or SCSS:
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
.livid-embed {
|
|
62
|
+
margin-bottom: 32px; /* adjust to match your site's heading/paragraph spacing */
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### Basic embed
|
|
69
|
+
|
|
70
|
+
```liquid
|
|
71
|
+
{% livid CEm15HFpXlBO %}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### With parameters
|
|
75
|
+
|
|
76
|
+
```liquid
|
|
77
|
+
{% livid CEm15HFpXlBO autoplay=true muted=true loop=true %}
|
|
78
|
+
{% livid CEm15HFpXlBO color=ff0000 controls=false %}
|
|
79
|
+
{% livid CEm15HFpXlBO dnt=true %}
|
|
80
|
+
{% livid CEm15HFpXlBO t=30 %}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `t` parameter starts playback at a specific second and is appended as a URL hash fragment (`#t=30`). All other parameters are appended as query string parameters.
|
|
84
|
+
|
|
85
|
+
## Advanced embedding parameters
|
|
86
|
+
|
|
87
|
+
All parameters from the [Livid advanced embedding documentation](https://support.livid.com/article/46-advanced-embedding-parameters) are supported. Boolean parameters accept `true`/`false` or `1`/`0`.
|
|
88
|
+
|
|
89
|
+
| Parameter | Values | Default | Notes |
|
|
90
|
+
|-----------|--------|---------|-------|
|
|
91
|
+
| `airplay` | true/false | true | AirPlay support (Safari only). Pro/Premium accounts. |
|
|
92
|
+
| `autoplay` | true/false | false | Autostart playback. |
|
|
93
|
+
| `background` | true/false | false | Background mode: no controls, loops, autoplay, muted. Pro/Premium. |
|
|
94
|
+
| `cc` | true/false | true | Closed captions button. Pro/Premium. |
|
|
95
|
+
| `chromecast` | true/false | true | Chromecast button. Pro/Premium. |
|
|
96
|
+
| `color` | hex code | 4e48f9 | Player control color (no `#`). Pro/Premium. |
|
|
97
|
+
| `colors` | 1–4 hex codes, comma-separated | — | Button, accent, icon/text, background. Pro/Premium. |
|
|
98
|
+
| `controls` | true/false | true | Show/hide all player controls. Pro/Premium. |
|
|
99
|
+
| `custom_logo` | true/false | — | Show custom logo. Pro/Premium. |
|
|
100
|
+
| `dnt` | true/false | false | Do Not Track — disables analytics. All videos. |
|
|
101
|
+
| `fullscreen` | true/false | true | Fullscreen button. Pro/Premium. |
|
|
102
|
+
| `keyboard` | true/false | true | Keyboard controls. All videos. |
|
|
103
|
+
| `livid_logo` | true/false | true | Show Livid logo. Pro/Premium. |
|
|
104
|
+
| `loop` | true/false | false | Loop the video. All videos. |
|
|
105
|
+
| `max_quality` | 240p–4k | auto | Maximum quality ceiling. Pro/Premium. |
|
|
106
|
+
| `min_quality` | 240p–4k | auto | Minimum quality floor. Pro/Premium. |
|
|
107
|
+
| `muted` | true/false | false | Mute on load. All videos. |
|
|
108
|
+
| `pip` | true/false | true | Picture-in-picture button. Pro/Premium. |
|
|
109
|
+
| `play_button_position` | auto/bottom/center | auto | Play button position. Pro/Premium. |
|
|
110
|
+
| `playsinline` | true/false | true | Inline playback on mobile. All videos. |
|
|
111
|
+
| `preload` | auto/metadata/none | none | Pre-playback loading behavior. All videos. |
|
|
112
|
+
| `progress_bar` | true/false | true | Progress bar. Pro/Premium. |
|
|
113
|
+
| `quality_selector` | true/false | true | Quality selector menu. Pro/Premium. |
|
|
114
|
+
| `share` | true/false | true | Share button. Pro/Premium. |
|
|
115
|
+
| `speed` | true/false | true | Speed controls. Pro/Premium. |
|
|
116
|
+
| `t` | seconds | 0 | Start at timestamp (appended as `#t=N`). All videos. |
|
|
117
|
+
| `title` | true/false | true | Show video title. Pro/Premium. |
|
|
118
|
+
| `transparent` | true/false | true | Transparent iframe background. All videos. |
|
|
119
|
+
| `volume` | true/false | true | Volume control. Pro/Premium. |
|
|
120
|
+
|
|
121
|
+
## Live example
|
|
122
|
+
|
|
123
|
+
- https://jasonchance.com/projects/jekyll-livid/
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
Install dependencies:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
bundle install
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Run tests:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
ruby -Ilib -Itest test/livid_tag_test.rb
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
require "cgi"
|
|
2
|
+
|
|
3
|
+
module Jekyll
|
|
4
|
+
class LividTag < Liquid::Tag
|
|
5
|
+
EMBED_BASE = "https://livid.com/embed/".freeze
|
|
6
|
+
|
|
7
|
+
# Parameters appended as URL hash fragments rather than query params
|
|
8
|
+
HASH_PARAMS = %w[t].freeze
|
|
9
|
+
|
|
10
|
+
# All supported advanced embed parameters
|
|
11
|
+
# https://support.livid.com/article/46-advanced-embedding-parameters
|
|
12
|
+
VALID_PARAMS = %w[
|
|
13
|
+
airplay autoplay background cc chromecast color colors controls
|
|
14
|
+
custom_logo dnt fullscreen keyboard livid_logo loop max_quality
|
|
15
|
+
min_quality muted pip play_button_position playsinline preload
|
|
16
|
+
progress_bar quality_selector share speed t title transparent volume
|
|
17
|
+
].freeze
|
|
18
|
+
|
|
19
|
+
def initialize(tag_name, markup, tokens)
|
|
20
|
+
super
|
|
21
|
+
parts = markup.strip.split(/\s+/, 2)
|
|
22
|
+
@video_id = parts[0]
|
|
23
|
+
@params = parse_params(parts[1] || "")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def render(_context)
|
|
27
|
+
raise "Livid tag requires a video ID" if @video_id.nil? || @video_id.empty?
|
|
28
|
+
|
|
29
|
+
query_params = @params.reject { |k, _| HASH_PARAMS.include?(k) }
|
|
30
|
+
hash_params = @params.select { |k, _| HASH_PARAMS.include?(k) }
|
|
31
|
+
|
|
32
|
+
src = EMBED_BASE + @video_id
|
|
33
|
+
src += "?" + query_params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join("&") unless query_params.empty?
|
|
34
|
+
src += "#t=#{hash_params['t']}" if hash_params['t']
|
|
35
|
+
|
|
36
|
+
<<~HTML.strip
|
|
37
|
+
<div class="livid-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
38
|
+
<iframe
|
|
39
|
+
src="#{src}"
|
|
40
|
+
frameborder="0"
|
|
41
|
+
allow="autoplay; fullscreen; picture-in-picture"
|
|
42
|
+
allowfullscreen
|
|
43
|
+
style="position:absolute;top:0;left:0;width:100%;height:100%;"
|
|
44
|
+
loading="lazy">
|
|
45
|
+
</iframe>
|
|
46
|
+
</div>
|
|
47
|
+
HTML
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
def parse_params(raw)
|
|
53
|
+
params = {}
|
|
54
|
+
raw.scan(/(\w+)=([^\s]+)/) do |key, value|
|
|
55
|
+
if VALID_PARAMS.include?(key)
|
|
56
|
+
params[key] = value
|
|
57
|
+
else
|
|
58
|
+
Jekyll.logger.warn "Livid tag:", "Unknown parameter '#{key}' — ignored"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
params
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Liquid::Template.register_tag("livid", Jekyll::LividTag)
|
data/lib/jekyll-livid.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-livid
|
|
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: A Jekyll plugin that provides a {% livid %} Liquid tag for embedding
|
|
27
|
+
Livid-hosted videos with full support for advanced embedding parameters.
|
|
28
|
+
email:
|
|
29
|
+
- jchance@gmail.com
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- CHANGELOG.md
|
|
35
|
+
- CONTRIBUTING.md
|
|
36
|
+
- LICENSE.txt
|
|
37
|
+
- README.md
|
|
38
|
+
- lib/jekyll-livid.rb
|
|
39
|
+
- lib/jekyll/livid_tag.rb
|
|
40
|
+
homepage: https://github.com/jchance/jekyll-livid
|
|
41
|
+
licenses:
|
|
42
|
+
- MIT
|
|
43
|
+
metadata:
|
|
44
|
+
homepage_uri: https://github.com/jchance/jekyll-livid
|
|
45
|
+
source_code_uri: https://github.com/jchance/jekyll-livid
|
|
46
|
+
changelog_uri: https://github.com/jchance/jekyll-livid/blob/main/CHANGELOG.md
|
|
47
|
+
bug_tracker_uri: https://github.com/jchance/jekyll-livid/issues
|
|
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: Jekyll Liquid tag for embedding Livid videos
|
|
65
|
+
test_files: []
|