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 +4 -4
- data/README.md +23 -5
- data/lib/jekyll-picture-tag-ng/version.rb +1 -1
- data/lib/jekyll-picture-tag-ng.rb +17 -5
- metadata +8 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c80e1b0df490ca860f65f796a037e343426db047d7fae6464512e64973c8966c
|
4
|
+
data.tar.gz: 01ca05c79fc48975cb21b91244b4b3edb10e77fcaccb655d4bf01a1204931e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
|
@@ -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.
|
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-
|
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: '
|
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: '
|
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://
|
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://
|
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:
|