jekyll-srcset-tag 0.1.3 → 0.1.4

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: d49f4f1c7e777fb4ed13911378f1d5c3514e9bbd
4
- data.tar.gz: fe446dcd3ace3765ea08d46486ec0e3dd7de1e95
3
+ metadata.gz: 194e7fb5c9eb2b7a53422c5ba2ae6a8104f0611a
4
+ data.tar.gz: 5f93965bacc7f99a446962d94ffb5eb591b7ae72
5
5
  SHA512:
6
- metadata.gz: 48c55e164e8eda6a503048ace59081d2e22675980c38c6aa58e669eb30556ae6e29175ee64e8f806dc7c7176ebcf3c2185d5fc366b3a69d5f8c6808ded52b92b
7
- data.tar.gz: caf01ea11c48e96231689199e37efa026491cfa900b761776b64fb4d42556e8ece7be465f3e0759f3bba269bc1dd2b9fb213d697c44b70fb060904c174c8ddd3
6
+ metadata.gz: 341e7fa5751f78a13664b187ff85263ddd2bb6227686cae831f26c703c083b270a0dc8c69e5968e3fb9227ea073720373a87916be6181a8ae90e21d6b57aa9b6
7
+ data.tar.gz: 0420a9375e8944b674d37a3f9afb0ae6ca11eef99a72b0e1b41a0bfaf72edf6f8bd8dba8fc462271a1f6469b4502bb77d2b446949e35925849ab17efb640c400
@@ -59,6 +59,14 @@ module Jekyll
59
59
  File.join(web_output_path, image_path + '-' + digest.slice(0, 7))
60
60
  end
61
61
 
62
+ def source_image_path
63
+ File.join(source_path, image_path)
64
+ end
65
+
66
+ def output_image_paths
67
+ uniq_instances.map { |instance| File.join(output_dir, instance.filename)}
68
+ end
69
+
62
70
  protected
63
71
 
64
72
  def create_instances
@@ -18,6 +18,8 @@ module Jekyll
18
18
  '<source ' + markup.join(' ') + ' />'
19
19
  end
20
20
 
21
+ protected
22
+
21
23
  def markup_to_hash(markup)
22
24
  matches = markup.scan(markup_regex)
23
25
  matches.each_with_object({}) do |match, memo|
@@ -16,7 +16,6 @@ module Jekyll
16
16
  .render(context)
17
17
  .gsub(/\\\{\\\{|\\\{\\%/, '\{\{' => '{{', '\{\%' => '{%')
18
18
 
19
- # set keep files
20
19
  settings = srcset_settings(context)
21
20
  site = context.registers[:site]
22
21
  site.config['keep_files'] << settings['output'] unless site.config['keep_files'].include?(settings['output'])
@@ -30,6 +29,8 @@ module Jekyll
30
29
  image.to_html
31
30
  end
32
31
 
32
+ protected
33
+
33
34
  def sources(content)
34
35
  # return sources objects
35
36
  html = Nokogiri::HTML(content)
@@ -75,6 +76,14 @@ module Jekyll
75
76
  settings['output'] ||= 'images/generated'
76
77
  settings
77
78
  end
79
+
80
+ def register_regenerate(context, image)
81
+ site = context.registers[:site]
82
+ if context.registers[:page] and context.registers[:page].has_key? 'path'
83
+ site.regenerator.add_dependency site.in_source_dir(context.registers[:page]['path']),
84
+ image.source_image_path
85
+ end
86
+ end
78
87
  end
79
88
  end
80
89
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module SrcsetTag
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-srcset-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Dew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll