jekyll-twitch 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/checks.yml +25 -0
- data/.github/workflows/deploy-demo.yml +17 -0
- data/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 +1 -0
- data/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/63/7e252fa8460c2278df772e6dfbf4934329e2f03a9174070b70d0883886b435 +11 -0
- data/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/e3/b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +2 -0
- data/.jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/fd/aa4200cef2544ec568b25970b3a49cf9b4f3d7015485506ccda914caf9c5b9 +19 -0
- data/.rubocop.yml +24 -0
- data/Gemfile +8 -4
- data/Gemfile.lock +24 -1
- data/README.md +16 -6
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/docs/.gitignore +5 -0
- data/docs/404.html +25 -0
- data/docs/Gemfile +40 -0
- data/docs/Gemfile.lock +117 -0
- data/docs/_config.yml +54 -0
- data/docs/_posts/2021-04-23-Version-1-Released.md +9 -0
- data/docs/channel.md +17 -0
- data/docs/clips.md +17 -0
- data/docs/collection.md +17 -0
- data/docs/index.markdown +31 -0
- data/docs/videos.md +17 -0
- data/jekyll-twitch.gemspec +16 -13
- data/lib/jekyll-twitch.rb +5 -2
- data/lib/jekyll-twitch/twitch_tag.rb +39 -10
- data/lib/jekyll-twitch/version.rb +3 -1
- metadata +21 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e8a9ab0203d9deaa19ce8d026ee33a63c013650961798c3ef9ca85ef27033ef
|
4
|
+
data.tar.gz: 2a82b63af6524ed3a23869f58452885609a9b5a26a97f90ea2976a4ca3c4b992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab5f9314d65a9538344b7df4cbf18a4edf6743f9b6589e80448c5f36cd9a3e595d118b37b97ec307516733046b77972c61a8fbd81ff93278597b62ec1b3ad01a
|
7
|
+
data.tar.gz: bd09c881bbb44701752de5b2b6f0044426234a48620a052bee37c7abf24fbf76fbb95f517ff213d8f384652423a4947ae19834f60426ec3761b1b9059cc24bfe
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Check Code
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
lint:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.7.2
|
13
|
+
- run: bundle install
|
14
|
+
- name: Rubocop
|
15
|
+
run: bundle exec rubocop
|
16
|
+
test:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: 2.7.2
|
23
|
+
- run: bundle install
|
24
|
+
- name: RSpec
|
25
|
+
run: bundle exec rspec
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Build and deploy Jekyll site to GitHub Pages
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
github-pages:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: helaili/jekyll-action@v2
|
14
|
+
with:
|
15
|
+
jekyll_src: 'docs'
|
16
|
+
target_branch: 'gh-pages'
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
@@ -0,0 +1 @@
|
|
1
|
+
I"u{"source"=>"/home/chael/Code/jekyll-twitch", "destination"=>"/home/chael/Code/jekyll-twitch/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title:output_ext"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>[], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>nil, "show_dir_listing"=>false, "permalink"=>"date", "paginate_path"=>"/page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge", "syntax_highlighter_opts"=>{:default_lang=>"plaintext", :guess_lang=>true}, "coderay"=>{}}, "livereload_port"=>35729, "serving"=>true, "watch"=>true, "url"=>nil}:ET
|
@@ -0,0 +1,11 @@
|
|
1
|
+
I"<p>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 <a href="https://jekyllrb.com/">jekyllrb.com</a></p>
|
2
|
+
|
3
|
+
<p>You can find the source code for Minima at GitHub:
|
4
|
+
<a href="https://github.com/jekyll">jekyll</a> /
|
5
|
+
<a href="https://github.com/jekyll/minima">minima</a></p>
|
6
|
+
|
7
|
+
<p>You can find the source code for Jekyll at GitHub:
|
8
|
+
<a href="https://github.com/jekyll">jekyll</a> /
|
9
|
+
<a href="https://github.com/jekyll/jekyll">jekyll</a></p>
|
10
|
+
|
11
|
+
:ET
|
@@ -0,0 +1,19 @@
|
|
1
|
+
I"9<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> 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 <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
|
2
|
+
|
3
|
+
<p>Jekyll requires blog post files to be named according to the following format:</p>
|
4
|
+
|
5
|
+
<p><code class="language-plaintext highlighter-rouge">YEAR-MONTH-DAY-title.MARKUP</code></p>
|
6
|
+
|
7
|
+
<p>Where <code class="language-plaintext highlighter-rouge">YEAR</code> is a four-digit number, <code class="language-plaintext highlighter-rouge">MONTH</code> and <code class="language-plaintext highlighter-rouge">DAY</code> are both two-digit numbers, and <code class="language-plaintext highlighter-rouge">MARKUP</code> is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
|
8
|
+
|
9
|
+
<p>Jekyll also offers powerful support for code snippets:</p>
|
10
|
+
|
11
|
+
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
|
12
|
+
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
|
13
|
+
<span class="k">end</span>
|
14
|
+
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
|
15
|
+
<span class="c1">#=> prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
|
16
|
+
|
17
|
+
<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>
|
18
|
+
|
19
|
+
:ET
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Hey maintainer!
|
2
|
+
# Don't forget you can exclude individual examples using
|
3
|
+
# rubocop:disable RSpec/ExampleLength
|
4
|
+
# You're smarter than the machine!
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
SuggestExtensions: false
|
8
|
+
NewCops: enable
|
9
|
+
require:
|
10
|
+
- rubocop-rspec
|
11
|
+
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Exclude:
|
14
|
+
- 'spec/**/*'
|
15
|
+
|
16
|
+
Naming/FileName:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/jekyll-twitch.rb'
|
19
|
+
|
20
|
+
RSpec/ImplicitSubject:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
RSpec/NestedGroups:
|
24
|
+
Enabled: false
|
data/Gemfile
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in jekyll-twitch.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
|
-
gem
|
7
|
-
gem
|
8
|
+
gem 'rake', '~> 12.0'
|
9
|
+
gem 'rspec', '~> 3.0'
|
10
|
+
gem 'rubocop'
|
11
|
+
gem 'rubocop-rspec'
|
8
12
|
|
9
|
-
gem
|
13
|
+
gem 'pry', '~> 0.14.0'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jekyll-twitch (0.
|
4
|
+
jekyll-twitch (1.0.0)
|
5
5
|
jekyll
|
6
6
|
|
7
7
|
GEM
|
@@ -9,6 +9,7 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.7.0)
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
12
|
+
ast (2.4.2)
|
12
13
|
coderay (1.1.3)
|
13
14
|
colorator (1.1.0)
|
14
15
|
concurrent-ruby (1.1.8)
|
@@ -51,16 +52,21 @@ GEM
|
|
51
52
|
rb-inotify (~> 0.9, >= 0.9.10)
|
52
53
|
mercenary (0.4.0)
|
53
54
|
method_source (1.0.0)
|
55
|
+
parallel (1.20.1)
|
56
|
+
parser (3.0.0.0)
|
57
|
+
ast (~> 2.4.1)
|
54
58
|
pathutil (0.16.2)
|
55
59
|
forwardable-extended (~> 2.6)
|
56
60
|
pry (0.14.0)
|
57
61
|
coderay (~> 1.1)
|
58
62
|
method_source (~> 1.0)
|
59
63
|
public_suffix (4.0.6)
|
64
|
+
rainbow (3.0.0)
|
60
65
|
rake (12.3.3)
|
61
66
|
rb-fsevent (0.10.4)
|
62
67
|
rb-inotify (0.10.1)
|
63
68
|
ffi (~> 1.0)
|
69
|
+
regexp_parser (2.1.1)
|
64
70
|
rexml (3.2.4)
|
65
71
|
rouge (3.26.0)
|
66
72
|
rspec (3.10.0)
|
@@ -76,6 +82,21 @@ GEM
|
|
76
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
77
83
|
rspec-support (~> 3.10.0)
|
78
84
|
rspec-support (3.10.2)
|
85
|
+
rubocop (1.12.0)
|
86
|
+
parallel (~> 1.10)
|
87
|
+
parser (>= 3.0.0.0)
|
88
|
+
rainbow (>= 2.2.2, < 4.0)
|
89
|
+
regexp_parser (>= 1.8, < 3.0)
|
90
|
+
rexml
|
91
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
92
|
+
ruby-progressbar (~> 1.7)
|
93
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
94
|
+
rubocop-ast (1.4.1)
|
95
|
+
parser (>= 2.7.1.5)
|
96
|
+
rubocop-rspec (2.2.0)
|
97
|
+
rubocop (~> 1.0)
|
98
|
+
rubocop-ast (>= 1.1.0)
|
99
|
+
ruby-progressbar (1.11.0)
|
79
100
|
safe_yaml (1.0.5)
|
80
101
|
sassc (2.4.0)
|
81
102
|
ffi (~> 1.9)
|
@@ -91,6 +112,8 @@ DEPENDENCIES
|
|
91
112
|
pry (~> 0.14.0)
|
92
113
|
rake (~> 12.0)
|
93
114
|
rspec (~> 3.0)
|
115
|
+
rubocop
|
116
|
+
rubocop-rspec
|
94
117
|
|
95
118
|
BUNDLED WITH
|
96
119
|
2.1.4
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Twitch
|
1
|
+
# Jekyll::Twitch
|
2
2
|
|
3
|
-
|
3
|
+
This gem allows you to embed twitch clips in your Jekyll websites. It adds and registers a new twitch liquid tag that accepts a twitch clip url.
|
4
4
|
|
5
|
-
|
5
|
+
`{% twitch https://www.twitch.tv/chaelcodes/clip/SpoopySlipperyGrasshopperPogChamp %}`
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -20,9 +20,19 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install jekyll-twitch
|
22
22
|
|
23
|
+
Then add Jekyll-Twitch to your `_config.yml` like so:
|
24
|
+
```
|
25
|
+
plugins:
|
26
|
+
- jekyll-twitch
|
27
|
+
```
|
28
|
+
|
23
29
|
## Usage
|
24
30
|
|
25
|
-
|
31
|
+
When building your site, Jekyll no longer substitutes `site.url` for localhost, which means Twitch embeds will not render. You need to supply host and localhost to view clips in development. `jekyll serve --host localhost --port 4000`
|
32
|
+
|
33
|
+
This is a Jekyll liquid tag, so just put `{% twitch https://www.twitch.tv/chaelcodes/clip/SpoopySlipperyGrasshopperPogChamp %}` to embed your clip.
|
34
|
+
|
35
|
+
We intend to support broadcasts and videos soon.
|
26
36
|
|
27
37
|
## Development
|
28
38
|
|
@@ -32,7 +42,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
42
|
|
33
43
|
## Contributing
|
34
44
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/ChaelCodes/jekyll-twitch. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ChaelCodes/jekyll-twitch/blob/
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ChaelCodes/jekyll-twitch. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ChaelCodes/jekyll-twitch/blob/main/CODE_OF_CONDUCT.md).
|
36
46
|
|
37
47
|
|
38
48
|
## License
|
@@ -41,4 +51,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
41
51
|
|
42
52
|
## Code of Conduct
|
43
53
|
|
44
|
-
Everyone interacting in the Twitch
|
54
|
+
Everyone interacting in the Jekyll::Twitch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ChaelCodes/jekyll-twitch/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'twitch_tag'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "twitch_tag"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/docs/.gitignore
ADDED
data/docs/404.html
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
permalink: /404.html
|
3
|
+
layout: default
|
4
|
+
---
|
5
|
+
|
6
|
+
<style type="text/css" media="screen">
|
7
|
+
.container {
|
8
|
+
margin: 10px auto;
|
9
|
+
max-width: 600px;
|
10
|
+
text-align: center;
|
11
|
+
}
|
12
|
+
h1 {
|
13
|
+
margin: 30px 0;
|
14
|
+
font-size: 4em;
|
15
|
+
line-height: 1;
|
16
|
+
letter-spacing: -1px;
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
|
20
|
+
<div class="container">
|
21
|
+
<h1>404</h1>
|
22
|
+
|
23
|
+
<p><strong>Page not found :(</strong></p>
|
24
|
+
<p>The requested page could not be found.</p>
|
25
|
+
</div>
|
data/docs/Gemfile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
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', '~> 4.2.0'
|
13
|
+
|
14
|
+
# there were issues with rubygems - remove these later
|
15
|
+
gem 'i18n', github: 'ruby-i18n/i18n'
|
16
|
+
gem 'rexml', github: 'ruby/rexml'
|
17
|
+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
18
|
+
gem 'minima', github: 'jekyll/minima'
|
19
|
+
|
20
|
+
# there were issues with rubygems - remove these later
|
21
|
+
gem 'listen', github: 'guard/listen'
|
22
|
+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
23
|
+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
24
|
+
# gem "github-pages", group: :jekyll_plugins
|
25
|
+
# If you have any plugins, put them here!
|
26
|
+
group :jekyll_plugins do
|
27
|
+
# remove github later, issues with rubygems
|
28
|
+
gem 'jekyll-feed', github: 'jekyll/jekyll-feed'
|
29
|
+
gem 'jekyll-twitch', github: 'ChaelCodes/jekyll-twitch', branch: 'main'
|
30
|
+
end
|
31
|
+
|
32
|
+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
33
|
+
# and associated library.
|
34
|
+
platforms :mingw, :x64_mingw, :mswin, :jruby do
|
35
|
+
gem 'tzinfo', '~> 1.2'
|
36
|
+
gem 'tzinfo-data'
|
37
|
+
end
|
38
|
+
|
39
|
+
# Performance-booster for watching directories on Windows
|
40
|
+
gem 'wdm', '~> 0.1.1', platforms: %i[mingw x64_mingw mswin]
|
data/docs/Gemfile.lock
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/ChaelCodes/jekyll-twitch.git
|
3
|
+
revision: 88757581284a7e8432ebf26d5fdbe325a02a2698
|
4
|
+
branch: main
|
5
|
+
specs:
|
6
|
+
jekyll-twitch (1.0.0)
|
7
|
+
jekyll
|
8
|
+
|
9
|
+
GIT
|
10
|
+
remote: https://github.com/guard/listen.git
|
11
|
+
revision: 96c9476af3ab383c150e7f533718a2b37d1ede66
|
12
|
+
specs:
|
13
|
+
listen (3.5.1)
|
14
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
15
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
16
|
+
|
17
|
+
GIT
|
18
|
+
remote: https://github.com/jekyll/jekyll-feed.git
|
19
|
+
revision: 6d4913fe5017c685d2437f328ab4a9138cea07a8
|
20
|
+
specs:
|
21
|
+
jekyll-feed (0.15.1)
|
22
|
+
jekyll (>= 3.7, < 5.0)
|
23
|
+
|
24
|
+
GIT
|
25
|
+
remote: https://github.com/jekyll/minima.git
|
26
|
+
revision: 3cdd14dff1216f561c68329e0b7420c2dc9b796a
|
27
|
+
specs:
|
28
|
+
minima (2.5.1)
|
29
|
+
jekyll (>= 3.5, < 5.0)
|
30
|
+
jekyll-feed (~> 0.9)
|
31
|
+
jekyll-seo-tag (~> 2.1)
|
32
|
+
|
33
|
+
GIT
|
34
|
+
remote: https://github.com/ruby-i18n/i18n.git
|
35
|
+
revision: f19ee0de1320671856dbc4375ab3f2716d13f03a
|
36
|
+
specs:
|
37
|
+
i18n (1.8.10)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
|
40
|
+
GIT
|
41
|
+
remote: https://github.com/ruby/rexml.git
|
42
|
+
revision: e941ff17ed3dad428d946b15524bb3529e684266
|
43
|
+
specs:
|
44
|
+
rexml (3.2.6)
|
45
|
+
|
46
|
+
GEM
|
47
|
+
remote: https://rubygems.org/
|
48
|
+
specs:
|
49
|
+
addressable (2.7.0)
|
50
|
+
public_suffix (>= 2.0.2, < 5.0)
|
51
|
+
colorator (1.1.0)
|
52
|
+
concurrent-ruby (1.1.8)
|
53
|
+
em-websocket (0.5.2)
|
54
|
+
eventmachine (>= 0.12.9)
|
55
|
+
http_parser.rb (~> 0.6.0)
|
56
|
+
eventmachine (1.2.7)
|
57
|
+
ffi (1.15.0)
|
58
|
+
forwardable-extended (2.6.0)
|
59
|
+
http_parser.rb (0.6.0)
|
60
|
+
jekyll (4.2.0)
|
61
|
+
addressable (~> 2.4)
|
62
|
+
colorator (~> 1.0)
|
63
|
+
em-websocket (~> 0.5)
|
64
|
+
i18n (~> 1.0)
|
65
|
+
jekyll-sass-converter (~> 2.0)
|
66
|
+
jekyll-watch (~> 2.0)
|
67
|
+
kramdown (~> 2.3)
|
68
|
+
kramdown-parser-gfm (~> 1.0)
|
69
|
+
liquid (~> 4.0)
|
70
|
+
mercenary (~> 0.4.0)
|
71
|
+
pathutil (~> 0.9)
|
72
|
+
rouge (~> 3.0)
|
73
|
+
safe_yaml (~> 1.0)
|
74
|
+
terminal-table (~> 2.0)
|
75
|
+
jekyll-sass-converter (2.1.0)
|
76
|
+
sassc (> 2.0.1, < 3.0)
|
77
|
+
jekyll-seo-tag (2.7.1)
|
78
|
+
jekyll (>= 3.8, < 5.0)
|
79
|
+
jekyll-watch (2.2.1)
|
80
|
+
listen (~> 3.0)
|
81
|
+
kramdown (2.3.1)
|
82
|
+
rexml
|
83
|
+
kramdown-parser-gfm (1.1.0)
|
84
|
+
kramdown (~> 2.0)
|
85
|
+
liquid (4.0.3)
|
86
|
+
mercenary (0.4.0)
|
87
|
+
pathutil (0.16.2)
|
88
|
+
forwardable-extended (~> 2.6)
|
89
|
+
public_suffix (4.0.6)
|
90
|
+
rb-fsevent (0.10.4)
|
91
|
+
rb-inotify (0.10.1)
|
92
|
+
ffi (~> 1.0)
|
93
|
+
rouge (3.26.0)
|
94
|
+
safe_yaml (1.0.5)
|
95
|
+
sassc (2.4.0)
|
96
|
+
ffi (~> 1.9)
|
97
|
+
terminal-table (2.0.0)
|
98
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
99
|
+
unicode-display_width (1.7.0)
|
100
|
+
|
101
|
+
PLATFORMS
|
102
|
+
ruby
|
103
|
+
|
104
|
+
DEPENDENCIES
|
105
|
+
i18n!
|
106
|
+
jekyll (~> 4.2.0)
|
107
|
+
jekyll-feed!
|
108
|
+
jekyll-twitch!
|
109
|
+
listen!
|
110
|
+
minima!
|
111
|
+
rexml!
|
112
|
+
tzinfo (~> 1.2)
|
113
|
+
tzinfo-data
|
114
|
+
wdm (~> 0.1.1)
|
115
|
+
|
116
|
+
BUNDLED WITH
|
117
|
+
2.1.4
|
data/docs/_config.yml
ADDED
@@ -0,0 +1,54 @@
|
|
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
|
+
# If you need help with YAML syntax, here are some quick references for you:
|
12
|
+
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
|
13
|
+
# https://learnxinyminutes.com/docs/yaml/
|
14
|
+
#
|
15
|
+
# Site settings
|
16
|
+
# These are used to personalize your new site. If you look in the HTML files,
|
17
|
+
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
|
18
|
+
# You can create any custom variable you would like, and they will be accessible
|
19
|
+
# in the templates via {{ site.myvariable }}.
|
20
|
+
|
21
|
+
title: Jekyll-Twitch Demo
|
22
|
+
email: chaelcodes@gmail.com
|
23
|
+
description: >- # this means to ignore newlines until "baseurl:"
|
24
|
+
You can use Jekyll-Twitch to embed Twitch clips in your Jekyll Site.
|
25
|
+
baseurl: "/jekyll-twitch" # the subpath of your site, e.g. /blog
|
26
|
+
url: "https://www.chael.codes" # the base hostname & protocol for your site, e.g. http://example.com
|
27
|
+
twitter_username: ChaelCodes
|
28
|
+
github_username: ChaelCodes
|
29
|
+
|
30
|
+
# Build settings
|
31
|
+
theme: minima
|
32
|
+
plugins:
|
33
|
+
- jekyll-feed
|
34
|
+
- jekyll-twitch
|
35
|
+
|
36
|
+
# Exclude from processing.
|
37
|
+
# The following items will not be processed, by default.
|
38
|
+
# Any item listed under the `exclude:` key here will be automatically added to
|
39
|
+
# the internal "default list".
|
40
|
+
#
|
41
|
+
# Excluded items can be processed by explicitly listing the directories or
|
42
|
+
# their entries' file path in the `include:` list.
|
43
|
+
#
|
44
|
+
# exclude:
|
45
|
+
# - .sass-cache/
|
46
|
+
# - .jekyll-cache/
|
47
|
+
# - gemfiles/
|
48
|
+
# - Gemfile
|
49
|
+
# - Gemfile.lock
|
50
|
+
# - node_modules/
|
51
|
+
# - vendor/bundle/
|
52
|
+
# - vendor/cache/
|
53
|
+
# - vendor/gems/
|
54
|
+
# - vendor/ruby/
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
layout: post
|
3
|
+
date: 2021-04-23
|
4
|
+
---
|
5
|
+
Version 1.0 of Jekyll-Twitch has just been released!
|
6
|
+
|
7
|
+
- embed now sizes to the parent div instead of being a fixed 1280x720
|
8
|
+
- See the example pages on the documentation site for more details
|
9
|
+
- Supports clips, channels, collections, and vods
|
data/docs/channel.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
title: Channel
|
4
|
+
permalink: /channel/
|
5
|
+
---
|
6
|
+
This embeds a live broadcast of a particular channel in your page or post.
|
7
|
+
|
8
|
+
{% raw %}
|
9
|
+
```
|
10
|
+
<div style="width:720px;height:480px">
|
11
|
+
{% twitch https://twitch.tv/ChaelCodes %}
|
12
|
+
</div>
|
13
|
+
```
|
14
|
+
{% endraw %}
|
15
|
+
<div style="width:720px;height:480px">
|
16
|
+
{% twitch https://twitch.tv/ChaelCodes %}
|
17
|
+
</div>
|
data/docs/clips.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
title: Clips
|
4
|
+
permalink: /clips/
|
5
|
+
---
|
6
|
+
This embed is used to add one Twitch clip to your page or post.
|
7
|
+
|
8
|
+
{% raw %}
|
9
|
+
```
|
10
|
+
<div style="width:720px;height:480px">
|
11
|
+
{% twitch https://www.twitch.tv/chaelcodes/clip/DeterminedSweetRedpandaDoritosChip-pQiRlDz6rQ9uvuuq %}
|
12
|
+
</div>
|
13
|
+
```
|
14
|
+
{% endraw %}
|
15
|
+
<div style="width:720px;height:480px">
|
16
|
+
{% twitch https://www.twitch.tv/chaelcodes/clip/DeterminedSweetRedpandaDoritosChip-pQiRlDz6rQ9uvuuq %}
|
17
|
+
</div>
|
data/docs/collection.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
title: Collection
|
4
|
+
permalink: /collection/
|
5
|
+
---
|
6
|
+
This embed is used to add a collection of videos to your page or post.
|
7
|
+
|
8
|
+
{% raw %}
|
9
|
+
```
|
10
|
+
<div style="width:720px;height:480px">
|
11
|
+
{% twitch https://www.twitch.tv/collections/x5bG2TGTeBYIRg %}
|
12
|
+
</div>
|
13
|
+
```
|
14
|
+
{% endraw %}
|
15
|
+
<div style="width:720px;height:480px">
|
16
|
+
{% twitch https://www.twitch.tv/collections/x5bG2TGTeBYIRg %}
|
17
|
+
</div>
|
data/docs/index.markdown
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
layout: home
|
3
|
+
---
|
4
|
+
This Liquid plugin lets you embed Twitch clips in your jekyll sites.
|
5
|
+
|
6
|
+
### Usage
|
7
|
+
1. Add the gem to your Gemfile.
|
8
|
+
```
|
9
|
+
group :jekyll_plugins do
|
10
|
+
gem 'jekyll-twitch'
|
11
|
+
end
|
12
|
+
```
|
13
|
+
2. Add it the plugin to your `_config.yml`.
|
14
|
+
```
|
15
|
+
plugins:
|
16
|
+
- jekyll-twitch
|
17
|
+
```
|
18
|
+
3. `bundle install` to install your gem.
|
19
|
+
4. Start your server. `bundle exec jekyll serve --host localhost --port 4000`
|
20
|
+
5. Embed Twitch on the page!
|
21
|
+
{% raw %}
|
22
|
+
```
|
23
|
+
<div style="width:720px;height:480px">
|
24
|
+
{% twitch https://www.twitch.tv/chaelcodes/clip/DeterminedSweetRedpandaDoritosChip-pQiRlDz6rQ9uvuuq %}
|
25
|
+
</div>
|
26
|
+
```
|
27
|
+
{% endraw %}
|
28
|
+
|
29
|
+
### Testing in Development
|
30
|
+
|
31
|
+
When building your site in development, Jekyll no longer substitutes `site.url` for localhost, which means Twitch embeds will not render. You need to supply host and localhost to view clips in development. `jekyll serve --host localhost --port 4000` This is not an issue in production.
|
data/docs/videos.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
layout: page
|
3
|
+
title: Videos
|
4
|
+
permalink: /videos/
|
5
|
+
---
|
6
|
+
Whether you call them videos, vods, or higlights, this will embed them in your page or psot.
|
7
|
+
|
8
|
+
{% raw %}
|
9
|
+
```
|
10
|
+
<div style="width:720px;height:480px">
|
11
|
+
{% twitch https://www.twitch.tv/videos/716698136 %}
|
12
|
+
</div>
|
13
|
+
```
|
14
|
+
{% endraw %}
|
15
|
+
<div style="width:720px;height:480px">
|
16
|
+
{% twitch https://www.twitch.tv/videos/716698136 %}
|
17
|
+
</div>
|
data/jekyll-twitch.gemspec
CHANGED
@@ -1,30 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/jekyll-twitch/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name =
|
6
|
+
spec.name = 'jekyll-twitch'
|
5
7
|
spec.version = Jekyll::Twitch::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
8
|
+
spec.authors = ['Rachael Wright-Munn']
|
9
|
+
spec.email = ['chaelcodes@gmail.com']
|
8
10
|
|
9
|
-
spec.summary =
|
10
|
-
spec.description =
|
11
|
-
|
12
|
-
spec.
|
13
|
-
spec.
|
11
|
+
spec.summary = 'Embed Twitch clips, VODs, and broadcasts in your Jekyll sites.'
|
12
|
+
spec.description = 'A gem that creates a TwitchTag liquid tag that allows Jekyll sites ' \
|
13
|
+
'to render Twitch clips, VODs, and broadcasts.'
|
14
|
+
spec.homepage = 'https://github.com/ChaelCodes/jekyll-twitch'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
|
14
17
|
|
15
18
|
# spec.metadata["allowed_push_host"] = "" # Used for private gem server
|
16
19
|
|
17
|
-
spec.metadata[
|
18
|
-
spec.metadata[
|
20
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
21
|
+
spec.metadata['source_code_uri'] = 'https://github.com/ChaelCodes/jekyll-twitch'
|
19
22
|
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
20
23
|
|
21
24
|
# Specify which files should be added to the gem when it is released.
|
22
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
-
spec.files
|
26
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
27
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
28
|
end
|
26
|
-
spec.bindir =
|
29
|
+
spec.bindir = 'exe'
|
27
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
31
|
+
spec.require_paths = ['lib']
|
29
32
|
spec.add_dependency 'jekyll'
|
30
33
|
end
|
data/lib/jekyll-twitch.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jekyll-twitch/version'
|
4
|
+
require 'jekyll-twitch/twitch_tag'
|
3
5
|
|
4
6
|
module Jekyll
|
7
|
+
# This is the module for Twitch stuff for Jekyll
|
5
8
|
module Twitch
|
6
9
|
end
|
7
10
|
end
|
@@ -1,39 +1,68 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'jekyll'
|
4
|
+
|
5
|
+
# These are all for Jekyll.
|
3
6
|
module Jekyll
|
7
|
+
# This is a liquid tag that embed Twitch Clips
|
8
|
+
# input is a url
|
4
9
|
class TwitchTag < Liquid::Tag
|
5
10
|
def initialize(_tag_name, content, _tokens)
|
6
11
|
super
|
7
|
-
@parsed_url = Jekyll::TwitchTag.parse_twitch_url content
|
12
|
+
@parsed_url = Jekyll::TwitchTag.parse_twitch_url content.strip
|
8
13
|
end
|
9
14
|
|
10
15
|
def render(context)
|
11
16
|
host = Jekyll::TwitchTag.site_url context
|
12
|
-
%
|
17
|
+
%(<iframe
|
13
18
|
src="#{@parsed_url}&parent=#{host}"
|
14
|
-
height="
|
15
|
-
width="
|
19
|
+
height="100%"
|
20
|
+
width="100%"
|
16
21
|
allowfullscreen="true">
|
17
22
|
</iframe>)
|
18
23
|
end
|
19
24
|
|
20
25
|
# Class Methods
|
26
|
+
def self.channel_url(url)
|
27
|
+
slug = url.match %r{(?<no>twitch.tv/)(?<channel>.+)/?\??}
|
28
|
+
"https://player.twitch.tv/?channel=#{slug[:channel]}&autoplay=false"
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.clip_url(url)
|
32
|
+
slug = url.match %r{(?<no>/clip/)(?<clip>.+)/?\??}
|
33
|
+
"https://clips.twitch.tv/embed?autoplay=false&clip=#{slug[:clip]}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.collection_url(url)
|
37
|
+
slug = url.match %r{(?<no>/collections/)(?<collection>.+)/?\??}
|
38
|
+
"https://player.twitch.tv/?collection=#{slug[:collection]}&autoplay=false"
|
39
|
+
end
|
40
|
+
|
21
41
|
def self.hostname(url)
|
22
|
-
matches = url.match %r{\A(https?://)?(?<host>[A-z.]+)(
|
42
|
+
matches = url.match %r{\A(?<safe>https?://)?(?<host>[A-z.]+)(?<port>:\d+)?}
|
23
43
|
matches[:host]
|
24
44
|
end
|
25
45
|
|
26
46
|
def self.parse_twitch_url(url)
|
27
|
-
url = url.strip
|
28
47
|
case url
|
29
48
|
when %r{/clip/}
|
30
|
-
|
31
|
-
|
49
|
+
clip_url url
|
50
|
+
when %r{/videos/}
|
51
|
+
video_url url
|
52
|
+
when %r{/collections/}
|
53
|
+
collection_url url
|
54
|
+
else
|
55
|
+
channel_url url
|
32
56
|
end
|
33
57
|
end
|
34
58
|
|
35
59
|
def self.site_url(context)
|
36
|
-
|
60
|
+
hostname(context.registers[:site].config['url'])
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.video_url(url)
|
64
|
+
slug = url.match %r{(?<no>/videos/)(?<vod>\d+)}
|
65
|
+
"https://player.twitch.tv/?video=#{slug[:vod]}&autoplay=false"
|
37
66
|
end
|
38
67
|
end
|
39
68
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-twitch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rachael Wright-Munn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -32,8 +32,15 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- ".github/workflows/checks.yml"
|
36
|
+
- ".github/workflows/deploy-demo.yml"
|
35
37
|
- ".gitignore"
|
38
|
+
- ".jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910"
|
39
|
+
- ".jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/63/7e252fa8460c2278df772e6dfbf4934329e2f03a9174070b70d0883886b435"
|
40
|
+
- ".jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/e3/b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
41
|
+
- ".jekyll-cache/Jekyll/Cache/Jekyll--Converters--Markdown/fd/aa4200cef2544ec568b25970b3a49cf9b4f3d7015485506ccda914caf9c5b9"
|
36
42
|
- ".rspec"
|
43
|
+
- ".rubocop.yml"
|
37
44
|
- CODE_OF_CONDUCT.md
|
38
45
|
- Gemfile
|
39
46
|
- Gemfile.lock
|
@@ -42,6 +49,17 @@ files:
|
|
42
49
|
- Rakefile
|
43
50
|
- bin/console
|
44
51
|
- bin/setup
|
52
|
+
- docs/.gitignore
|
53
|
+
- docs/404.html
|
54
|
+
- docs/Gemfile
|
55
|
+
- docs/Gemfile.lock
|
56
|
+
- docs/_config.yml
|
57
|
+
- docs/_posts/2021-04-23-Version-1-Released.md
|
58
|
+
- docs/channel.md
|
59
|
+
- docs/clips.md
|
60
|
+
- docs/collection.md
|
61
|
+
- docs/index.markdown
|
62
|
+
- docs/videos.md
|
45
63
|
- jekyll-twitch.gemspec
|
46
64
|
- lib/jekyll-twitch.rb
|
47
65
|
- lib/jekyll-twitch/twitch_tag.rb
|
@@ -60,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
78
|
requirements:
|
61
79
|
- - ">="
|
62
80
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
81
|
+
version: 2.4.0
|
64
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
83
|
requirements:
|
66
84
|
- - ">="
|