jekyll-html5-youtube 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +21 -0
- data/README.md +99 -0
- data/examples/custom/Gemfile +31 -0
- data/examples/default/.bundle/config +4 -0
- data/examples/default/.gitignore +4 -0
- data/examples/default/Gemfile +29 -0
- data/examples/default/Gemfile.lock +60 -0
- data/examples/default/_config.yml +36 -0
- data/examples/default/_posts/2017-02-12-welcome-to-jekyll.markdown +25 -0
- data/examples/default/about.md +15 -0
- data/examples/default/index.md +13 -0
- data/lib/jekyll-html5-youtube/version.rb +1 -1
- data/lib/jekyll-html5-youtube.rb +2 -2
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb605a840b744d0859a6af7cfaa68cd13e4dba4e
|
4
|
+
data.tar.gz: 6909695e762070fc2818a04f16952bf9bd46a459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8cabd611deba644d86d7b9d1530605a6e595dbf8a418cd6814077c14e4abc7a7d9f940d217a14e97d6be0996f38248ffa5fd4176a79ae39fb2563d1bbe8cd8a
|
7
|
+
data.tar.gz: 89da1ab4859e27b69e7b39001244847f81f4bfc60d8cf0c37cf52e054acfa14db8da856eefb482376b1ad3e5d89431c9794f78c9b44ac9296f151f8307428a2d
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 knowbl
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
# Jekyll HTML5 Youtube
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/jekyll-html5-youtube.svg)](https://badge.fury.io/rb/jekyll-html5-youtube)
|
4
|
+
|
5
|
+
Jekyll plugin to generate clean html5 snippets for embedding YouTube videos, without iframes.
|
6
|
+
|
7
|
+
## Table of contents
|
8
|
+
|
9
|
+
* [Installation](#installation)
|
10
|
+
* [Usage](#usage)
|
11
|
+
* [Result](#result)
|
12
|
+
* [Examples](#examples)
|
13
|
+
* [Author](#author)
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
```bash
|
18
|
+
gem install jekyll-html5-youtube
|
19
|
+
```
|
20
|
+
|
21
|
+
and put this at the bottom of the ``gems:`` section, in your ``_config.yml``
|
22
|
+
|
23
|
+
```yaml
|
24
|
+
gems:
|
25
|
+
- jekyll-html5-youtube
|
26
|
+
```
|
27
|
+
|
28
|
+
add this to your CSS file
|
29
|
+
|
30
|
+
```css
|
31
|
+
.embed-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%}
|
32
|
+
.embed-container object{position:absolute;top:0;left:0;width:100%;height:100%}
|
33
|
+
```
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
{% youtube "https://www.youtube.com/watch?v=abcd5678" %}
|
39
|
+
```
|
40
|
+
|
41
|
+
You can also use
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
{% youtube "https://www.youtube.com/embed/abcd5678" %}
|
45
|
+
{% youtube "https://youtu.be/abcd5678" %}
|
46
|
+
```
|
47
|
+
|
48
|
+
## Result
|
49
|
+
|
50
|
+
By default the plugin will output
|
51
|
+
|
52
|
+
```html
|
53
|
+
<div class="embed-container">
|
54
|
+
<object data="https://www.youtube.com/embed/abcd5678"></object>
|
55
|
+
</div>
|
56
|
+
```
|
57
|
+
|
58
|
+
You can write your own snippet by creating a file in ``_includes`` called ``youtube.html``. The YouTube ID is displayed using ``{{ youtube_id }}``.
|
59
|
+
|
60
|
+
Example ``youtube.html``:
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
<object data="https://www.youtube.com/embed/{{ youtube_id }}" style="width:100%;height:100vh"></object>
|
64
|
+
```
|
65
|
+
|
66
|
+
## Examples
|
67
|
+
|
68
|
+
For troubleshooting, or just a quick start using ``jekyll-html5-youtube``, you can look inside the ``examples`` folder.
|
69
|
+
|
70
|
+
``examples/default`` is using the default output.
|
71
|
+
|
72
|
+
``examples/custom`` is a custom output for the partial, using ``_includes/youtube.html``.
|
73
|
+
|
74
|
+
## TODO
|
75
|
+
|
76
|
+
- [x] Add examples.
|
77
|
+
- [ ] Support for timecode feature.
|
78
|
+
- [ ] Support for playlists.
|
79
|
+
- [ ] Support for channel information display.
|
80
|
+
- [ ] Bug hunt.
|
81
|
+
|
82
|
+
## Feedback/Contributing
|
83
|
+
|
84
|
+
Any direct feedback can be given here:
|
85
|
+
|
86
|
+
[https://knowbl.co/contact/](https://knowbl.co/contact/)
|
87
|
+
|
88
|
+
Or raise an issue
|
89
|
+
|
90
|
+
[https://github.com/knowbl/jekyll-html5-youtube/issues](https://github.com/knowbl/jekyll-html5-youtube/issues)
|
91
|
+
|
92
|
+
## AUTHOR
|
93
|
+
|
94
|
+
Written by [Lorenzo Sapora](https://sush.us) for [Knowbl](https://knowbl.co).
|
95
|
+
|
96
|
+
- [Blog](https://sush.us/)
|
97
|
+
- [Github](https://github.com/lorenzosapora/)
|
98
|
+
- [Gitlab mirror](https://git.knowbl.co/public)
|
99
|
+
- [Twitter](https://twitter.com/lorenzosapora)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
ruby RUBY_VERSION
|
3
|
+
|
4
|
+
# Hello! This is where you manage which Jekyll version is used to run.
|
5
|
+
# When you want to use a different version, change it below, save the
|
6
|
+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
7
|
+
#
|
8
|
+
# bundle exec jekyll serve
|
9
|
+
#
|
10
|
+
# This will help ensure the proper Jekyll version is running.
|
11
|
+
# Happy Jekylling!
|
12
|
+
gem "jekyll", "3.4.0"
|
13
|
+
|
14
|
+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
15
|
+
gem "minima", "~> 2.0"
|
16
|
+
|
17
|
+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
18
|
+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
19
|
+
# gem "github-pages", group: :jekyll_plugins
|
20
|
+
|
21
|
+
gem "jekyll-html5-youtube", "~> 0.3"
|
22
|
+
|
23
|
+
# If you have any plugins, put them here!
|
24
|
+
group :jekyll_plugins do
|
25
|
+
gem "jekyll-feed", "~> 0.6"
|
26
|
+
# gem "jekyll-html5-youtube", "~> 0.3"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
30
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
31
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
ruby RUBY_VERSION
|
3
|
+
|
4
|
+
# Hello! This is where you manage which Jekyll version is used to run.
|
5
|
+
# When you want to use a different version, change it below, save the
|
6
|
+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
7
|
+
#
|
8
|
+
# bundle exec jekyll serve
|
9
|
+
#
|
10
|
+
# This will help ensure the proper Jekyll version is running.
|
11
|
+
# Happy Jekylling!
|
12
|
+
gem "jekyll", "3.4.0"
|
13
|
+
|
14
|
+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
15
|
+
gem "minima", "~> 2.0"
|
16
|
+
|
17
|
+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
18
|
+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
19
|
+
# gem "github-pages", group: :jekyll_plugins
|
20
|
+
|
21
|
+
# If you have any plugins, put them here!
|
22
|
+
group :jekyll_plugins do
|
23
|
+
gem "jekyll-feed", "~> 0.6"
|
24
|
+
gem "jekyll-html5-youtube", "~> 0.0.3"
|
25
|
+
end
|
26
|
+
|
27
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
28
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
29
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.5.0)
|
5
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
6
|
+
colorator (1.1.0)
|
7
|
+
ffi (1.9.17)
|
8
|
+
forwardable-extended (2.6.0)
|
9
|
+
jekyll (3.4.0)
|
10
|
+
addressable (~> 2.4)
|
11
|
+
colorator (~> 1.0)
|
12
|
+
jekyll-sass-converter (~> 1.0)
|
13
|
+
jekyll-watch (~> 1.1)
|
14
|
+
kramdown (~> 1.3)
|
15
|
+
liquid (~> 3.0)
|
16
|
+
mercenary (~> 0.3.3)
|
17
|
+
pathutil (~> 0.9)
|
18
|
+
rouge (~> 1.7)
|
19
|
+
safe_yaml (~> 1.0)
|
20
|
+
jekyll-feed (0.8.0)
|
21
|
+
jekyll (~> 3.3)
|
22
|
+
jekyll-html5-youtube (0.0.3)
|
23
|
+
jekyll (~> 3.4)
|
24
|
+
jekyll-sass-converter (1.5.0)
|
25
|
+
sass (~> 3.4)
|
26
|
+
jekyll-watch (1.5.0)
|
27
|
+
listen (~> 3.0, < 3.1)
|
28
|
+
kramdown (1.13.2)
|
29
|
+
liquid (3.0.6)
|
30
|
+
listen (3.0.8)
|
31
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
32
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
33
|
+
mercenary (0.3.6)
|
34
|
+
minima (2.1.0)
|
35
|
+
jekyll (~> 3.3)
|
36
|
+
pathutil (0.14.0)
|
37
|
+
forwardable-extended (~> 2.6)
|
38
|
+
public_suffix (2.0.5)
|
39
|
+
rb-fsevent (0.9.8)
|
40
|
+
rb-inotify (0.9.8)
|
41
|
+
ffi (>= 0.5.0)
|
42
|
+
rouge (1.11.1)
|
43
|
+
safe_yaml (1.0.4)
|
44
|
+
sass (3.4.23)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
ruby
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
jekyll (= 3.4.0)
|
51
|
+
jekyll-feed (~> 0.6)
|
52
|
+
jekyll-html5-youtube (~> 0.0.3)
|
53
|
+
minima (~> 2.0)
|
54
|
+
tzinfo-data
|
55
|
+
|
56
|
+
RUBY VERSION
|
57
|
+
ruby 2.0.0p648
|
58
|
+
|
59
|
+
BUNDLED WITH
|
60
|
+
1.14.3
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Welcome to Jekyll!
|
2
|
+
#
|
3
|
+
# This config file is meant for settings that affect your whole blog, values
|
4
|
+
# which you are expected to set up once and rarely edit after that. If you find
|
5
|
+
# yourself editing this file very often, consider using Jekyll's data files
|
6
|
+
# feature for the data you need to update frequently.
|
7
|
+
#
|
8
|
+
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
9
|
+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
|
10
|
+
|
11
|
+
# Site settings
|
12
|
+
# These are used to personalize your new site. If you look in the HTML files,
|
13
|
+
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
|
14
|
+
# You can create any custom variable you would like, and they will be accessible
|
15
|
+
# in the templates via {{ site.myvariable }}.
|
16
|
+
title: Your awesome title
|
17
|
+
email: your-email@domain.com
|
18
|
+
description: > # this means to ignore newlines until "baseurl:"
|
19
|
+
Write an awesome description for your new site here. You can edit this
|
20
|
+
line in _config.yml. It will appear in your document head meta (for
|
21
|
+
Google search results) and in your feed.xml site description.
|
22
|
+
baseurl: "" # the subpath of your site, e.g. /blog
|
23
|
+
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
24
|
+
twitter_username: jekyllrb
|
25
|
+
github_username: jekyll
|
26
|
+
|
27
|
+
# Build settings
|
28
|
+
markdown: kramdown
|
29
|
+
theme: minima
|
30
|
+
gems:
|
31
|
+
- jekyll-feed
|
32
|
+
- jekyll-html5-youtube
|
33
|
+
exclude:
|
34
|
+
- Gemfile
|
35
|
+
- Gemfile.lock
|
36
|
+
- vendor
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
layout: post
|
3
|
+
title: "Welcome to Jekyll!"
|
4
|
+
date: 2017-02-12 22:01:50 +0000
|
5
|
+
categories: jekyll update
|
6
|
+
---
|
7
|
+
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
8
|
+
|
9
|
+
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
|
10
|
+
|
11
|
+
Jekyll also offers powerful support for code snippets:
|
12
|
+
|
13
|
+
{% highlight ruby %}
|
14
|
+
def print_hi(name)
|
15
|
+
puts "Hi, #{name}"
|
16
|
+
end
|
17
|
+
print_hi('Tom')
|
18
|
+
#=> prints 'Hi, Tom' to STDOUT.
|
19
|
+
{% endhighlight %}
|
20
|
+
|
21
|
+
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
|
22
|
+
|
23
|
+
[jekyll-docs]: https://jekyllrb.com/docs/home
|
24
|
+
[jekyll-gh]: https://github.com/jekyll/jekyll
|
25
|
+
[jekyll-talk]: https://talk.jekyllrb.com/
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
title: About
|
4
|
+
permalink: /about/
|
5
|
+
---
|
6
|
+
|
7
|
+
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
|
8
|
+
|
9
|
+
You can find the source code for the Jekyll new theme at:
|
10
|
+
{% include icon-github.html username="jekyll" %} /
|
11
|
+
[minima](https://github.com/jekyll/minima)
|
12
|
+
|
13
|
+
You can find the source code for Jekyll at
|
14
|
+
{% include icon-github.html username="jekyll" %} /
|
15
|
+
[jekyll](https://github.com/jekyll/jekyll)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
# You don't need to edit this file, it's empty on purpose.
|
3
|
+
# Edit theme's home layout instead if you wanna make some changes
|
4
|
+
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
|
5
|
+
layout: home
|
6
|
+
---
|
7
|
+
|
8
|
+
<style scoped>
|
9
|
+
.embed-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%}
|
10
|
+
.embed-container object{position:absolute;top:0;left:0;width:100%;height:100%}
|
11
|
+
</style>
|
12
|
+
|
13
|
+
{% youtube "https://youtu.be/NM2wtte1JRE" %}
|
data/lib/jekyll-html5-youtube.rb
CHANGED
@@ -10,10 +10,10 @@ class YouTubeEmbed < Liquid::Tag
|
|
10
10
|
|
11
11
|
def render(context)
|
12
12
|
youtube_url = "#{context[@text.strip]}"
|
13
|
-
if youtube_url[/youtu\.be\/([
|
13
|
+
if youtube_url[/youtu\.be\/([^*]*)/]
|
14
14
|
@youtube_id = $1
|
15
15
|
else
|
16
|
-
youtube_url[/^.*((v\/)|(embed\/)|(watch\?))\??v?=?([
|
16
|
+
youtube_url[/^.*((v\/)|(embed\/)|(watch\?))\??v?=?([^\*\?]*).*/]
|
17
17
|
@youtube_id = $5
|
18
18
|
end
|
19
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-html5-youtube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorenzo Sapora
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -61,8 +61,18 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
+
- LICENSE.md
|
64
65
|
- README.md
|
65
66
|
- Rakefile
|
67
|
+
- examples/custom/Gemfile
|
68
|
+
- examples/default/.bundle/config
|
69
|
+
- examples/default/.gitignore
|
70
|
+
- examples/default/Gemfile
|
71
|
+
- examples/default/Gemfile.lock
|
72
|
+
- examples/default/_config.yml
|
73
|
+
- examples/default/_posts/2017-02-12-welcome-to-jekyll.markdown
|
74
|
+
- examples/default/about.md
|
75
|
+
- examples/default/index.md
|
66
76
|
- jekyll-html5-youtube.gemspec
|
67
77
|
- lib/jekyll-html5-youtube.rb
|
68
78
|
- lib/jekyll-html5-youtube/version.rb
|