jekyll-thumbnail 0.1.18 → 0.2.0.pre.alpha.pre.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +4 -1
- data/.travis.yml +6 -0
- data/Gemfile +10 -2
- data/LICENSE.txt +0 -0
- data/Rakefile +10 -1
- data/docs/README.md +48 -0
- data/docs/_config.yml +1 -0
- data/img/sample_rectangle.jpg +0 -0
- data/img/sample_square.jpg +0 -0
- data/img/watermark-50x50.png +0 -0
- data/jekyll-thumbnail.gemspec +1 -0
- data/lib/jekyll-thumbnail/version.rb +1 -1
- data/lib/jekyll-thumbnail.rb +1 -10
- metadata +11 -6
- data/README.md +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3d9b3507c2dacf8eb0d592a04aa85945abe95989f2a1aeb7a924e1a13f4ea756
|
4
|
+
data.tar.gz: cd23a6bb2eadb7d35b69048a7cfa5eaf2879c27b78f09ee16091a89e577f2782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f1875a0b4871cf443b8cc6b357e5ccc4156622791fa9d72f330da90377e52bebf3ffdacd0529c6c13651f93cad5c93cb5c4fd001fc13e2c7c99f873ebee61b
|
7
|
+
data.tar.gz: 04f7b0d5d9510f928351e233c85ec1e9e4750a26731bf4aa0f08c1dc01fda35f71ad9ceead950132fb680f0dc98068d9f4510a6406b7fb29428c6bc652188ade
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
+
gemspec
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
group :test do
|
5
|
+
gem 'rails-controller-testing' # If you are using Rails 5.x
|
6
|
+
gem 'liquid'
|
7
|
+
gem 'mini_magick'
|
8
|
+
gem 'minitest'
|
9
|
+
gem 'fastimage'
|
10
|
+
|
11
|
+
gem 'coveralls', require: false
|
12
|
+
end
|
data/LICENSE.txt
CHANGED
File without changes
|
data/Rakefile
CHANGED
data/docs/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Jekyll Thumbnail
|
2
|
+
[![Build Status](https://travis-ci.org/superterran/jekyll-thumbnail.svg?branch=master)](https://travis-ci.org/superterran/jekyll-thumbnail)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/superterran/jekyll-thumbnail/badge.svg?branch=master)](https://coveralls.io/github/superterran/jekyll-thumbnail?branch=master)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/jekyll-thumbnail.svg)](https://badge.fury.io/rb/jekyll-thumbnail)
|
5
|
+
|
6
|
+
Adds a liquid tag that can generate thumbnails, with watermarks, at any size you dictate.
|
7
|
+
|
8
|
+
# Usage
|
9
|
+
|
10
|
+
Require the ruby gem in your Gemfile...
|
11
|
+
|
12
|
+
```
|
13
|
+
gem 'jekyll-thumbnail'
|
14
|
+
```
|
15
|
+
|
16
|
+
Then, use it in your Liquid templates as follows:
|
17
|
+
|
18
|
+
```
|
19
|
+
{% thumbnail path/to/image.jpg 50x50 %}
|
20
|
+
```
|
21
|
+
This will pass the image through the thumbnailer, and generate a thumbs/ directory where the image is located.
|
22
|
+
|
23
|
+
# Thumbs directory
|
24
|
+
|
25
|
+
Images that already exist are not re-generated, so you can save yourself some work by caching these files.
|
26
|
+
|
27
|
+
# Unit Tests
|
28
|
+
|
29
|
+
Running Rake will work through all the minitest tests for this feature...
|
30
|
+
|
31
|
+
```
|
32
|
+
$ rake
|
33
|
+
```
|
34
|
+
|
35
|
+
# Installation
|
36
|
+
|
37
|
+
Inside your gemfile...
|
38
|
+
|
39
|
+
```
|
40
|
+
gem "jekyll-thumbnail"
|
41
|
+
```
|
42
|
+
|
43
|
+
# Building and Releasing
|
44
|
+
|
45
|
+
```
|
46
|
+
$ gem build jekyll-thumbnail.gemspec
|
47
|
+
$ gem push jekyll-thumbnail-0.1.18.gem
|
48
|
+
```
|
data/docs/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-tactile
|
Binary file
|
Binary file
|
Binary file
|
data/jekyll-thumbnail.gemspec
CHANGED
@@ -7,6 +7,7 @@ require "jekyll-thumbnail/version"
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "jekyll-thumbnail"
|
9
9
|
spec.version = Jekyll::Thumbnail::VERSION
|
10
|
+
spec.version = "#{spec.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
10
11
|
spec.authors = ["Doug Hatcher"]
|
11
12
|
spec.email = ["superterran@gmail.com"]
|
12
13
|
|
data/lib/jekyll-thumbnail.rb
CHANGED
@@ -48,15 +48,6 @@ class JekyllThumbnail < Liquid::Tag
|
|
48
48
|
if !File.exists?(dest_path) || File.mtime(dest_path) <= File.mtime(source_path)
|
49
49
|
# puts ENV.inspect
|
50
50
|
|
51
|
-
# don't generate images in preview mode whenever possible
|
52
|
-
if ENV['OCTOPRESS_ENV'] == 'preview' && /(?<width>\d+)?x(?<height>\d+)?/ =~ dimensions
|
53
|
-
html = "<img src='#{source}' style='"
|
54
|
-
html << "max-width: #{width}px; " unless width.nil? || width.empty?
|
55
|
-
html << "max-height: #{height}px;" unless height.nil? || height.empty?
|
56
|
-
html << "' />"
|
57
|
-
return html
|
58
|
-
end
|
59
|
-
|
60
51
|
puts "Thumbnailing #{source} to #{dest} (#{dimensions})"
|
61
52
|
|
62
53
|
image = MiniMagick::Image.open(source_path)
|
@@ -78,7 +69,7 @@ class JekyllThumbnail < Liquid::Tag
|
|
78
69
|
|
79
70
|
# TODO support relative paths
|
80
71
|
else
|
81
|
-
"Could not create thumbnail for #{source}. Usage: thumbnail /path/to/local/image.png 50x50
|
72
|
+
"Could not create thumbnail for #{source}. Usage: thumbnail /path/to/local/image.png 50x50"
|
82
73
|
end
|
83
74
|
end
|
84
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-thumbnail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.pre.alpha.pre.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Hatcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -60,10 +60,15 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
|
-
- README.md
|
66
66
|
- Rakefile
|
67
|
+
- docs/README.md
|
68
|
+
- docs/_config.yml
|
69
|
+
- img/sample_rectangle.jpg
|
70
|
+
- img/sample_square.jpg
|
71
|
+
- img/watermark-50x50.png
|
67
72
|
- jekyll-thumbnail.gemspec
|
68
73
|
- lib/jekyll-thumbnail.rb
|
69
74
|
- lib/jekyll-thumbnail/version.rb
|
@@ -82,12 +87,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
87
|
version: '0'
|
83
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
89
|
requirements:
|
85
|
-
- - "
|
90
|
+
- - ">"
|
86
91
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
92
|
+
version: 1.3.1
|
88
93
|
requirements: []
|
89
94
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.7.8
|
91
96
|
signing_key:
|
92
97
|
specification_version: 4
|
93
98
|
summary: Provides an image thumbnailer with watermark support. Adds a liquid tag
|
data/README.md
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Jekyll Thumbnail
|
2
|
-
|
3
|
-
Adds a liquid tag that can generate thumbnails, with watermarks, at any size you dictate.
|
4
|
-
|
5
|
-
# Installation
|
6
|
-
|
7
|
-
Inside your gemfile...
|
8
|
-
|
9
|
-
```
|
10
|
-
gem "jekyll-thumbnail"
|
11
|
-
```
|
12
|
-
|
13
|
-
# Building and Releasing
|
14
|
-
|
15
|
-
```
|
16
|
-
$ gem build jekyll-thumbnail.gemspec
|
17
|
-
$ gem push jekyll-theme-artsy-0.1.11.gem
|
18
|
-
```
|