mirror of
https://github.com/danbee/jekyll-video-tag
synced 2025-03-04 08:59:11 +00:00
Make it a gem.
This commit is contained in:
parent
209e9b499f
commit
1b0dcca677
23
.gitignore
vendored
23
.gitignore
vendored
@ -1 +1,22 @@
|
||||
.sass-cache
|
||||
*.gem
|
||||
*.rbc
|
||||
.bundle
|
||||
.config
|
||||
.yardoc
|
||||
Gemfile.lock
|
||||
InstalledFiles
|
||||
_yardoc
|
||||
coverage
|
||||
doc/
|
||||
lib/bundler/man
|
||||
pkg
|
||||
rdoc
|
||||
spec/reports
|
||||
test/tmp
|
||||
test/version_tmp
|
||||
tmp
|
||||
*.bundle
|
||||
*.so
|
||||
*.o
|
||||
*.a
|
||||
mkmf.log
|
||||
|
||||
4
Gemfile
Normal file
4
Gemfile
Normal file
@ -0,0 +1,4 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in jekyll-video-tag.gemspec
|
||||
gemspec
|
||||
21
LICENCE.txt
21
LICENCE.txt
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Dan Barber
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
22
LICENSE.txt
Normal file
22
LICENSE.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2014 Dan Barber
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
34
README.md
34
README.md
@ -1,19 +1,39 @@
|
||||
# Jekyll Video Tag
|
||||
|
||||
**Easy responsive videos for Jekyll.**
|
||||
|
||||
Jekyll Video Tag is a liquid tag that adds responsive videos to your [Jekyll](http://jekyllrb.com) static site.
|
||||
|
||||
### Usage
|
||||
## Installation
|
||||
|
||||
Place the `video_tag.rb` file in your `_plugins` directory and add the CSS or Sass file to your site.
|
||||
Add this line to your application's Gemfile:
|
||||
|
||||
```liquid
|
||||
gem 'jekyll_video_tag'
|
||||
|
||||
And then execute:
|
||||
|
||||
$ bundle
|
||||
|
||||
Or install it yourself as:
|
||||
|
||||
$ gem install jekyll_video_tag
|
||||
|
||||
## Usage
|
||||
|
||||
``` liquid
|
||||
{% video {embed-url} width={width} height={height} %}
|
||||
```
|
||||
|
||||
### Example
|
||||
The embed URL is the one that is referenced by the iframe in the video embed code.
|
||||
|
||||
```liquid
|
||||
### Example:
|
||||
|
||||
``` liquid
|
||||
{% video //www.youtube.com/embed/7eP4pw03PCg width=560 height=315 %}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork it ( https://github.com/danbee/jekyll_video_tag/fork )
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create a new Pull Request
|
||||
|
||||
23
jekyll_video_tag.gemspec
Normal file
23
jekyll_video_tag.gemspec
Normal file
@ -0,0 +1,23 @@
|
||||
# coding: utf-8
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require 'jekyll_video_tag/version'
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "jekyll_video_tag"
|
||||
spec.version = JekyllVideoTag::VERSION
|
||||
spec.authors = ["Dan Barber"]
|
||||
spec.email = ["hello@danbarber.me"]
|
||||
spec.summary = %q{TODO: Write a short summary. Required.}
|
||||
spec.description = %q{TODO: Write a longer description. Optional.}
|
||||
spec.homepage = ""
|
||||
spec.license = "MIT"
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 1.6"
|
||||
spec.add_development_dependency "rake"
|
||||
end
|
||||
@ -1,18 +1,5 @@
|
||||
# Plugin for rendering responsive video in Jekyll
|
||||
# Written by: Dan Barber
|
||||
# Version: 0.0.2
|
||||
# ===============================================
|
||||
# Usage:
|
||||
# ------
|
||||
# {% video {embed-url} width={width} height={height} %}
|
||||
#
|
||||
# The embed URL is the one that is referenced by the iframe in the video embed code.
|
||||
#
|
||||
# Example:
|
||||
# {% video //www.youtube.com/embed/7eP4pw03PCg width=560 height=315 %}
|
||||
|
||||
module Jekyll
|
||||
class VideoTag < Liquid::Tag
|
||||
module JekyllVideoTag
|
||||
class Tag < Liquid::Tag
|
||||
def initialize(tag_name, input, tokens)
|
||||
super
|
||||
@url = input.slice!(/[^ ]+/)
|
||||
@ -43,4 +30,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('video', Jekyll::VideoTag)
|
||||
Liquid::Template.register_tag('video', JekyllVideoTag::Tag)
|
||||
3
lib/jekyll_video_tag/version.rb
Normal file
3
lib/jekyll_video_tag/version.rb
Normal file
@ -0,0 +1,3 @@
|
||||
module JekyllVideoTag
|
||||
VERSION = "0.0.2"
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user