jekyll-picture-tag-ng 0.1.0 → 0.2.0

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: 3a3bd675a4d3cc241525f392330a1c83bb216ea3a0b493af4c6c962e64443719
4
- data.tar.gz: b97828fb4b03cffe94b235a6ee09212b2d9f12c0c8bbd24ecbc1772809edebf6
3
+ metadata.gz: c80e1b0df490ca860f65f796a037e343426db047d7fae6464512e64973c8966c
4
+ data.tar.gz: 01ca05c79fc48975cb21b91244b4b3edb10e77fcaccb655d4bf01a1204931e63
5
5
  SHA512:
6
- metadata.gz: b3aafd32911452696625b1f5cff39b86bfe707e3caa7d41b94a2172834c0d229884d5517b44bb7c7da13985e8e2a6164727fb3680f03100ba024bb3317df6be2
7
- data.tar.gz: 8720af12c5eaa95d89edd1ce3300611c8d1037b3b9ff2cadccd8d9548b9190127b8541c36a3675a98b61fbda0eae27b1dc5668c85985053563646f82f2f8960b
6
+ metadata.gz: 6f26606f005ec4adb371ca0b78a3996a06be725ef4fcec1d1c6b7a4f11d21d76523809d7e9ac56bbe50dc63b0fddcf6de97fbcad290793e213d4d71ff7715435
7
+ data.tar.gz: 5aa9f85970686bfdd076d5898d496d70f4ef7b8cbb4845ad3f727b3a539367cbcb0a50ba395dce998f98bf50ce43005e0b6233a10824af721c0180f87231c5f5
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. Developped for and used on [Crocodile Couture](https://crocodile-couture.fr)
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,15 +18,29 @@ Additionally, you will need [ImageMagick](https://imagemagick.org/) installed on
18
18
 
19
19
  After installing, update your `_config.yml` to include the plugin :
20
20
 
21
- ```
21
+ ```yaml
22
22
  plugins: [other-plugins, jekyll-picture-tag-ng]
23
23
  ```
24
24
 
25
+ or
26
+
27
+ ```yaml
28
+ plugins:
29
+ - other-plugins
30
+ - jekyll-picture-tag-ng
31
+ ```
32
+
25
33
  ### Using with GitHub Pages
26
34
 
27
- If you're using GitHub Pages to deploy your site, you'll need to use a custom action to be able to use this plugin and install ImageMagick. You can create such GitHub action by browsing to `https://github.com/{YOUR/REPO}/new/main?filename=.github%2Fworkflows%2Fjekyll.yml&workflow_template=pages%2Fjekyll`. You will need to add the following lines as a step for the build job of your GitHub action (before the `jekyll build` command) :
35
+ If you're using GitHub Pages to deploy your site, you'll need to use a custom action to be able to use this plugin and install ImageMagick. You can create such GitHub action by browsing to
28
36
 
29
37
  ```
38
+ https://github.com/{YOUR/REPO}/new/main?filename=.github%2Fworkflows%2Fjekyll.yml&workflow_template=pages%2Fjekyll
39
+ ```
40
+
41
+ You will need to add the following lines as a step for the build job of your GitHub action (before the `jekyll build` command) :
42
+
43
+ ```yaml
30
44
  - name: Install imagemagick
31
45
  run: sudo apt-get update && sudo apt-get install imagemagick
32
46
  ```
@@ -60,9 +74,13 @@ The example above is equivalent to the defaults.
60
74
 
61
75
  ## Development
62
76
 
63
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
77
+ 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 :
78
+
79
+ $ bundle remove jekyll-picture-tag-ng # if you previously used jekyll-picture-tag-ng from rubygems
80
+ $ bundle add --path /absolute/or/relative/path/to/your/local/jekyll-picture-tag-ng/repo jekyll-picture-tag-ng
81
+ $ bundle exec jekyll serve # Re-run this when you want to test changes to your local jekyll-picture-tag-ng
64
82
 
65
- To install this gem onto your local machine, run `bundle exec rake install`. 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 [rubygems.org](https://rubygems.org).
83
+ 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 [rubygems.org](https://rubygems.org).
66
84
 
67
85
  ## Contributing
68
86
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module PictureTag
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -51,11 +51,6 @@ module Jekyll
51
51
  @destination[dest] ||= output_basename
52
52
  end
53
53
 
54
- def write(*args)
55
- Jekyll.logger.debug "write : #{args} Modified : #{modified?}"
56
- super(*args)
57
- end
58
-
59
54
  def popen_args(dest_path)
60
55
  args = ["convert", @path, "-resize", "#{@picture_dim}x>"]
61
56
  if @pictype == "jpg"
@@ -101,6 +96,23 @@ Jekyll::Hooks.register :site, :after_init do |site|
101
96
  Kramdown::Converter::JEKYLL_SITE = site
102
97
  end
103
98
 
99
+ module Jekyll
100
+ # Override the write methid to paralellize it
101
+ class Site
102
+ 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)
107
+ end
108
+ threads.each(&:join)
109
+ regenerator.write_metadata
110
+ Jekyll::Hooks.trigger :site, :post_write, self
111
+ nil
112
+ end
113
+ end
114
+ end
115
+
104
116
  module Kramdown
105
117
  module Parser
106
118
  # Override Kramdown parser
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-picture-tag-ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
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-10 00:00:00.000000000 Z
11
+ date: 2023-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: kramdown
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '0'
19
+ version: '4.2'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ">="
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: '4.2'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +70,13 @@ files:
84
70
  - lib/jekyll-picture-tag-ng.rb
85
71
  - lib/jekyll-picture-tag-ng/version.rb
86
72
  - sig/jekyll/picture_tag.rbs
87
- homepage: https://github.com/pcouy/jekyll-picture-tag-ng
73
+ homepage: https://pierre-couy.dev/projects/jekyll-picture-tag-ng.html
88
74
  licenses:
89
75
  - MIT
90
76
  metadata:
91
77
  allowed_push_host: https://rubygems.org
92
- homepage_uri: https://github.com/pcouy/jekyll-picture-tag-ng
78
+ homepage_uri: https://pierre-couy.dev/projects/jekyll-picture-tag-ng.html
93
79
  source_code_uri: https://github.com/pcouy/jekyll-picture-tag-ng
94
- changelog_uri: https://github.com/pcouy/jekyll-picture-tag-ng/main/CHANGELOG.md
95
80
  post_install_message:
96
81
  rdoc_options: []
97
82
  require_paths: