jekyll-thumbnail 0 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -4
- data/Gemfile +2 -10
- data/LICENSE.txt +0 -0
- data/README.md +18 -0
- data/Rakefile +1 -10
- data/jekyll-thumbnail.gemspec +0 -2
- data/lib/jekyll-thumbnail.rb +10 -1
- data/lib/jekyll-thumbnail/version.rb +1 -1
- metadata +4 -9
- data/.travis.yml +0 -6
- data/docs/README.md +0 -48
- data/docs/_config.yml +0 -1
- data/img/sample_rectangle.jpg +0 -0
- data/img/sample_square.jpg +0 -0
- data/img/watermark-50x50.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 163bff733b73f13d3b015bdb0dfb0e692942fdd1
|
4
|
+
data.tar.gz: fc54b2d9acd1a95c49f6388142fd40be3e38bc2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2cf03cf87d65108a3f44dea2db92e726c4ffbe2c177cf74b7bb7342d4df8300255bc20a3fcb2ab4cc131cee4ebdd34479c930b144d570a6f22fabffa265de13
|
7
|
+
data.tar.gz: 200a5ae7c4c1047019a0600c9ccb64d3875eef3ea6a9859eb489609d5cfcc392dbe0be09cb1c29c1cc7f3348029dc79e971396d530c155bd03cbe69436d0e0fa
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,12 +1,4 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
gemspec
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
gem 'liquid'
|
7
|
-
gem 'mini_magick'
|
8
|
-
gem 'minitest'
|
9
|
-
gem 'fastimage'
|
10
|
-
|
11
|
-
gem 'coveralls', require: false
|
12
|
-
end
|
3
|
+
# Specify your gem's dependencies in jekyllcontentful.gemspec
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
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
|
+
```
|
data/Rakefile
CHANGED
data/jekyll-thumbnail.gemspec
CHANGED
@@ -7,8 +7,6 @@ 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'] && !ENV['TRAVIS_TAG']
|
11
|
-
spec.version = ENV['TRAVIS_TAG'] if ENV['TRAVIS'] && ENV['TRAVIS_TAG']
|
12
10
|
spec.authors = ["Doug Hatcher"]
|
13
11
|
spec.email = ["superterran@gmail.com"]
|
14
12
|
|
data/lib/jekyll-thumbnail.rb
CHANGED
@@ -48,6 +48,15 @@ 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
|
+
|
51
60
|
puts "Thumbnailing #{source} to #{dest} (#{dimensions})"
|
52
61
|
|
53
62
|
image = MiniMagick::Image.open(source_path)
|
@@ -69,7 +78,7 @@ class JekyllThumbnail < Liquid::Tag
|
|
69
78
|
|
70
79
|
# TODO support relative paths
|
71
80
|
else
|
72
|
-
"Could not create thumbnail for #{source}. Usage: thumbnail /path/to/local/image.png 50x50"
|
81
|
+
"Could not create thumbnail for #{source}. Usage: thumbnail /path/to/local/image.png 50x50<"
|
73
82
|
end
|
74
83
|
end
|
75
84
|
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:
|
4
|
+
version: 0.1.18
|
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-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -60,15 +60,10 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".travis.yml"
|
64
63
|
- Gemfile
|
65
64
|
- 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
|
72
67
|
- jekyll-thumbnail.gemspec
|
73
68
|
- lib/jekyll-thumbnail.rb
|
74
69
|
- lib/jekyll-thumbnail/version.rb
|
@@ -92,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
87
|
version: '0'
|
93
88
|
requirements: []
|
94
89
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.5.2.1
|
96
91
|
signing_key:
|
97
92
|
specification_version: 4
|
98
93
|
summary: Provides an image thumbnailer with watermark support. Adds a liquid tag
|
data/.travis.yml
DELETED
data/docs/README.md
DELETED
@@ -1,48 +0,0 @@
|
|
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
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
theme: jekyll-theme-tactile
|
data/img/sample_rectangle.jpg
DELETED
Binary file
|
data/img/sample_square.jpg
DELETED
Binary file
|
data/img/watermark-50x50.png
DELETED
Binary file
|