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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: a5a15728a0433da2e53ee8c73a691393be1f048eabca4a8074c948b952c27d57
4
- data.tar.gz: eca3165043c17a48cc537c52898944dd4e5fe719e61e7074831a0c7d772e0b38
2
+ SHA1:
3
+ metadata.gz: 163bff733b73f13d3b015bdb0dfb0e692942fdd1
4
+ data.tar.gz: fc54b2d9acd1a95c49f6388142fd40be3e38bc2e
5
5
  SHA512:
6
- metadata.gz: 679f7fe3af42e77876b5ad8c5c914afa25d9947ced9876666e771373bb9381a8b6a574559a82701af804feb932934ba0ae96e78e32220161f1dc9d061f84aaa9
7
- data.tar.gz: 674c4f30391cf964d182b10831b108b07ad882380b174f3cc9824054e67246f8c322beff6d4164b0b5ffa9c7d767bff1da6546d76e25f73ac57cce898ab78401
6
+ metadata.gz: f2cf03cf87d65108a3f44dea2db92e726c4ffbe2c177cf74b7bb7342d4df8300255bc20a3fcb2ab4cc131cee4ebdd34479c930b144d570a6f22fabffa265de13
7
+ data.tar.gz: 200a5ae7c4c1047019a0600c9ccb64d3875eef3ea6a9859eb489609d5cfcc392dbe0be09cb1c29c1cc7f3348029dc79e971396d530c155bd03cbe69436d0e0fa
data/.gitignore CHANGED
@@ -1,4 +1 @@
1
- /Gemfile.lock
2
- test/thumbs
3
- pkg/
4
- coverage/
1
+ *.gem
data/Gemfile CHANGED
@@ -1,12 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
3
2
 
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
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
@@ -1,10 +1 @@
1
- require "bundler/gem_tasks"
2
- require 'rake/testtask'
3
-
4
- task :default => :test
5
-
6
- Rake::TestTask.new do |t|
7
- t.libs << 'lib' << 'test'
8
- t.pattern = 'test/**/test_*.rb'
9
- t.warning = false
10
- end
1
+ require "bundler/gem_tasks"
@@ -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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Thumbnail
3
- VERSION = "0.2.0"
3
+ VERSION = "0.1.18"
4
4
  end
5
5
  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.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-25 00:00:00.000000000 Z
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.7.8
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
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3
4
- deploy:
5
- provider: rubygems
6
- api_key: $RUBYGEMS_API_KEY
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
Binary file
Binary file
Binary file