jekyll-picture-tag-ng 0.2.0 → 0.2.2

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
  SHA256:
3
- metadata.gz: c80e1b0df490ca860f65f796a037e343426db047d7fae6464512e64973c8966c
4
- data.tar.gz: 01ca05c79fc48975cb21b91244b4b3edb10e77fcaccb655d4bf01a1204931e63
3
+ metadata.gz: 24fa31a62f9db299a6bf311f5e9e6786497bf759e26bc1c29ca1e320331c91cc
4
+ data.tar.gz: 0472a2f6a44a0a358be737bb2c3bfd42bc5bd266d9c96bedb027a9f889bd0207
5
5
  SHA512:
6
- metadata.gz: 6f26606f005ec4adb371ca0b78a3996a06be725ef4fcec1d1c6b7a4f11d21d76523809d7e9ac56bbe50dc63b0fddcf6de97fbcad290793e213d4d71ff7715435
7
- data.tar.gz: 5aa9f85970686bfdd076d5898d496d70f4ef7b8cbb4845ad3f727b3a539367cbcb0a50ba395dce998f98bf50ce43005e0b6233a10824af721c0180f87231c5f5
6
+ metadata.gz: a9d425639ebb2ac9db33b231b19acd323eaa0efa7d3df9cb4aa8233df1c4395f1e1c6d561701d8e6c6389633d6c535e63969663df2b8fa485d873456915cd7de
7
+ data.tar.gz: be4985d422441d0ad62dea7f401982d4edb30ce05e01d1819a22eaefe3efef88c7099e1cf702fd79295546ab46d59f3347edbb2bebad180147c191628b72c294
data/README.md CHANGED
@@ -61,6 +61,7 @@ Configuration is done in the `_config.yml` of your website, under the `picture_t
61
61
 
62
62
  ```yaml
63
63
  picture_tag_ng:
64
+ parallel: false
64
65
  background_color: FFFFFF
65
66
  picture_versions:
66
67
  m: 700
@@ -71,6 +72,7 @@ The example above is equivalent to the defaults.
71
72
 
72
73
  - `background_color` is the color used to replace transparency when converting from `webp` to `jpeg`
73
74
  - `picture_versions` maps version names to target widths in pixels. The default configuration above produces output files 700px wide in `img/m/` and 400px wide in `img/s/`.
75
+ - `parallel` is a boolean indicating if you want to generate the output files in parallel threads. With a website that has a lot of large pictures, I get ~30% speed improvements when generating the site locally. However, this seems to make building the site with the recommended Github workflow fail.
74
76
 
75
77
  ## Development
76
78
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module PictureTag
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -99,16 +99,23 @@ end
99
99
  module Jekyll
100
100
  # Override the write methid to paralellize it
101
101
  class Site
102
+ alias_method "old_write", "write"
103
+
102
104
  def write
103
- Jekyll::Commands::Doctor.conflicting_urls(self)
104
- threads = []
105
- each_site_file do |item|
106
- threads << Thread.new { item.write(dest) } if regenerator.regenerate?(item)
105
+ if config["picture_tag_ng"]["parallel"]
106
+ Jekyll.logger.info "Writing files in parallel (should not work on GH Pages)"
107
+ Jekyll::Commands::Doctor.conflicting_urls(self)
108
+ threads = []
109
+ each_site_file do |item|
110
+ threads << Thread.new { item.write(dest) } if regenerator.regenerate?(item)
111
+ end
112
+ threads.each(&:join)
113
+ regenerator.write_metadata
114
+ Jekyll::Hooks.trigger :site, :post_write, self
115
+ nil
116
+ else
117
+ old_write
107
118
  end
108
- threads.each(&:join)
109
- regenerator.write_metadata
110
- Jekyll::Hooks.trigger :site, :post_write, self
111
- nil
112
119
  end
113
120
  end
114
121
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-picture-tag-ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pcouy