jekyll-picture-tag-ng 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/jekyll-picture-tag-ng/version.rb +1 -1
- data/lib/jekyll-picture-tag-ng.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fadd4c9864e9f27681da9e346142a1024a78a21f0bb574b664dca6b49eb814f
|
4
|
+
data.tar.gz: 13b0413c9c635423188f138c8bbf384fb19c6922faea298b4a2c854d88709db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2328763294129ccfb827e0050af52095165d0379eaaf44df9376d71161c390d68a1fb90bb61b683b8f9502f82ca45efb2228420e9141490b7a960a0f49cafee3
|
7
|
+
data.tar.gz: 332667daa306a34cd4dbcdb0bf5e84a9f6eef395b93f6252e203c2640b9d2e496bdb5eae38b6f06f720f88a5be9a078d5087ead83ba4f8c47f436086b95c9789
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Jekyll Picture Tag NG
|
2
2
|
|
3
|
-
This plugin will automatically generate variants of your pictures on build, and change the Kramdown rendering to use the variants with HTML picture tags when including pictures from markdown.
|
3
|
+
This plugin will automatically generate variants of your pictures on build, and change the Kramdown rendering to use the variants with HTML picture tags when including pictures from markdown. Developed for and used on [Crocodile Couture](https://crocodile-couture.fr)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -53,7 +53,7 @@ By installing the plugin and activating it, `jekyll build` and `jekyll serve` co
|
|
53
53
|
|
54
54
|
When using the default markdown syntax for including pictures (``) with the Kramdown renderer, `<picture>` tags with appropriate `<source>` children tags will be output.
|
55
55
|
|
56
|
-
When working locally,
|
56
|
+
When working locally, you can use the `--incremental` option to prevent Jekyll from re-generating all the pictures (which can take a long time) when re-launching the `jekyll serve` command. This is useful when developing a plugin or tweaking the `_config.yml` file (which both require you to frequently re-launch the `jekyll serve` command). However, be careful about using this option when changing the plugin's output image formats : the plugin will skip generating the new output formats in `--incremental` mode for pictures that were previously generated for the old output formats.
|
57
57
|
|
58
58
|
### Configuration
|
59
59
|
|
@@ -73,18 +73,18 @@ The example above is equivalent to the defaults.
|
|
73
73
|
|
74
74
|
- `background_color` is the color used to replace transparency when converting from `webp` to `jpeg`
|
75
75
|
- `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/`.
|
76
|
-
- `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.
|
77
|
-
- `threads` is the number of concurrent threads for generating the website (only used if `parallel` is `true`
|
76
|
+
- `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.
|
77
|
+
- `threads` is the number of concurrent threads for generating the website (only used if `parallel` is `true`)
|
78
78
|
|
79
79
|
## Development
|
80
80
|
|
81
|
-
After cloning the repo, you can run the following commands in a local
|
81
|
+
After cloning the repo, you can run the following commands in a local Jekyll website's folder to start hacking on the code of `jekyll-picture-tag-ng` (you'll need to replace the path in the second command) :
|
82
82
|
|
83
83
|
$ bundle remove jekyll-picture-tag-ng # if you previously used jekyll-picture-tag-ng from rubygems
|
84
84
|
$ bundle add --path /absolute/or/relative/path/to/your/local/jekyll-picture-tag-ng/repo jekyll-picture-tag-ng
|
85
85
|
$ bundle exec jekyll serve # Re-run this when you want to test changes to your local jekyll-picture-tag-ng
|
86
86
|
|
87
|
-
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [
|
87
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [the Rubygems repository](https://rubygems.org).
|
88
88
|
|
89
89
|
## Contributing
|
90
90
|
|
@@ -127,6 +127,10 @@ module Jekyll
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
def reset_thread_pool
|
131
|
+
@thread_pool = nil
|
132
|
+
end
|
133
|
+
|
130
134
|
def next_task
|
131
135
|
@task_queue ||= []
|
132
136
|
@task_queue.shift
|
@@ -139,7 +143,7 @@ module Jekyll
|
|
139
143
|
|
140
144
|
def write
|
141
145
|
if config["picture_tag_ng"]["parallel"]
|
142
|
-
Jekyll.logger.info "Writing files in parallel
|
146
|
+
Jekyll.logger.info "Writing files in parallel"
|
143
147
|
Jekyll::Commands::Doctor.conflicting_urls(self)
|
144
148
|
each_site_file do |item|
|
145
149
|
regenerator.regenerate?(item) && add_task { item.write(dest) }
|
@@ -148,6 +152,7 @@ module Jekyll
|
|
148
152
|
add_task { -1 }
|
149
153
|
end
|
150
154
|
thread_pool.each(&:join)
|
155
|
+
reset_thread_pool
|
151
156
|
regenerator.write_metadata
|
152
157
|
Jekyll::Hooks.trigger :site, :post_write, self
|
153
158
|
nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-picture-tag-ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pcouy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|