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 +4 -4
- data/README.md +2 -0
- data/lib/jekyll-picture-tag-ng/version.rb +1 -1
- data/lib/jekyll-picture-tag-ng.rb +15 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24fa31a62f9db299a6bf311f5e9e6786497bf759e26bc1c29ca1e320331c91cc
|
4
|
+
data.tar.gz: 0472a2f6a44a0a358be737bb2c3bfd42bc5bd266d9c96bedb027a9f889bd0207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -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
|
-
|
104
|
-
|
105
|
-
|
106
|
-
threads
|
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
|