middleman-async-image 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: 2695b7fdcd355ab7149c49eba1eb6d8c07f714c8
4
- data.tar.gz: 4b3fd03f53092eadabf83271543462e507546f93
3
+ metadata.gz: 723a925899fe9829fa13d15e17b8d9769658bc3d
4
+ data.tar.gz: 2a7377c1d92691b6f7f92349b1385b45369fc8f7
5
5
  SHA512:
6
- metadata.gz: e59ccc7fd382cf9a201806d9f99883ec619b6af583bd8f71de8feba6f7a9d738385147df1cd11e5fc87a942cf11da0846f2cae339bf03b6b83fcc1f388ffd065
7
- data.tar.gz: 3865e1b878b21dc532f16c2e09d511aab6825c0eedf2a86efff0ccfbaab31857440231eb940e224a46c9d87ed47530b1660978e2daf4878dcd8c7473dbfbfc8e
6
+ metadata.gz: c96f4d70584d31ca1e7107b14a80288ff7e444cd17be8e9bb71e2f00da948dd5018283c8d59923f429ef30d214e40e907e54ff0a3b982ee96a305e604d0e4ae5
7
+ data.tar.gz: 864c10c317c2fdbe594f4039141021086330e1c98b2a0a3d2441b283b381c31dc02d683a00b1a3d081158fdeaa4c86c3b240607eb50afa03a2859b7efc12eaf3
data/README.md CHANGED
@@ -6,6 +6,9 @@ Load your images asynchronously with Middleman : like Medium.
6
6
  ## Why?
7
7
  Because loading images on poor connections is really ugly. Medium as a great image loader so I develop a Gem to make it same as Middleman.
8
8
 
9
+ ## What about SEO ?
10
+ Check the [SEO markdown](SEO.md) file! (ut everithing is well)
11
+
9
12
  ## But how exactly it works ?
10
13
  This gem detect when you want to load an image asynchronously (when you're using the helper). It going to duplicate it, with really strong compression and scale in a separate folder. Then, a JS function will load the poor quality image firstly, and the HQ image asynchronously. When the great image will be loaded, the other image will disappear.
11
14
 
data/SEO.md ADDED
@@ -0,0 +1,6 @@
1
+ # SEO
2
+ Because yes, that's the point, how it works with **Google** ?
3
+
4
+ ## Quite good !
5
+ ![demo](SEO.png?raw=true)
6
+ The low quality image is not indexed, the high quality image is perfectly indexed, everything working good!
data/SEO.png ADDED
Binary file
data/TODO.md CHANGED
@@ -1,2 +1 @@
1
- # WIP !
2
- Automatic image helper will be do ASAP.
1
+ # NOTHING RIGHT NOW
@@ -21,7 +21,7 @@ class AsyncImage < ::Middleman::Extension
21
21
  end
22
22
 
23
23
  def compress_dir
24
- dir = "source/#{app.config[:images_dir]}/" + extensions[:async_image].options[:compress_image_path]
24
+ dir = "source/#{app.config[:images_dir]}/" + options.compress_image_path
25
25
  unless Dir.exists?(dir)
26
26
  FileUtils.mkdir(dir)
27
27
  end
@@ -34,15 +34,17 @@ class AsyncImage < ::Middleman::Extension
34
34
 
35
35
  helpers do
36
36
  def image_async_tag(path, params={})
37
- complete_path = "source/#{app.config[:images_dir]}/" + extensions[:async_image].options[:compress_image_path] + '/' + path
37
+ options = extensions[:async_image].options
38
+
39
+ complete_path = "source/#{app.config[:images_dir]}/" + options[:compress_image_path] + '/' + path
38
40
  FileUtils.mkdir_p(complete_path.match(/(.*\/)+(.*$)/)[1])
39
41
 
40
42
  Magick::Image::read("source/#{app.config[:images_dir]}/" + path)[0]
41
- .scale(extensions[:async_image].options[:scale])
42
- .write(complete_path){|f| f.quality = extensions[:async_image].options[:quality] }
43
+ .scale(options[:scale])
44
+ .write(complete_path){|f| f.quality = options[:quality] }
43
45
  print(path + ' has been compressed')
44
46
 
45
- params['data-compress'] = image_path(extensions[:async_image].options[:compress_image_path] + '/' + path)
47
+ params['data-compress'] = image_path(options[:compress_image_path] + '/' + path)
46
48
  begin
47
49
  params[:class] += ' async-image'
48
50
  rescue
@@ -3,13 +3,13 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "middleman-async-image"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Bastien Robert"]
9
- # s.email = ["email@example.com"]
10
- # s.homepage = "http://example.com"
11
- s.summary = "Load your images asynchronous"
12
- # s.description = %q{A longer description of your extension}
9
+ s.email = ["bastienrobert@outlook.com"]
10
+ s.homepage = "https://github.com/bastienrobert/middleman-async-image"
11
+ s.summary = "Load your images asynchronously"
12
+ s.description = "Finally a gem to load automaticly your images asynchronously, like Medium."
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-async-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bastien Robert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-26 00:00:00.000000000 Z
11
+ date: 2018-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -38,8 +38,9 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.0
41
- description:
42
- email:
41
+ description: Finally a gem to load automaticly your images asynchronously, like Medium.
42
+ email:
43
+ - bastienrobert@outlook.com
43
44
  executables: []
44
45
  extensions: []
45
46
  extra_rdoc_files: []
@@ -49,6 +50,8 @@ files:
49
50
  - LICENSE
50
51
  - README.md
51
52
  - Rakefile
53
+ - SEO.md
54
+ - SEO.png
52
55
  - TODO.md
53
56
  - demo.gif
54
57
  - features/support/env.rb
@@ -57,7 +60,7 @@ files:
57
60
  - middleman-async-image.gemspec
58
61
  - vendor/assets/javascripts/async-image.js
59
62
  - vendor/assets/stylesheets/async-image.css
60
- homepage:
63
+ homepage: https://github.com/bastienrobert/middleman-async-image
61
64
  licenses: []
62
65
  metadata: {}
63
66
  post_install_message:
@@ -79,6 +82,6 @@ rubyforge_project:
79
82
  rubygems_version: 2.6.13
80
83
  signing_key:
81
84
  specification_version: 4
82
- summary: Load your images asynchronous
85
+ summary: Load your images asynchronously
83
86
  test_files:
84
87
  - features/support/env.rb