jekyll-og-image 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll_og_image/generator.rb +5 -5
- data/lib/jekyll_og_image/version.rb +1 -1
- data/lib/jekyll_og_image.rb +0 -2
- 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: e885b900b05e7a8b46a221a0850e682815081837e102044dfa02141d5c86b41c
|
4
|
+
data.tar.gz: 7665d1a4ce49f9a422d1823513f1c6a5cc4a0bbb7e532904288ad3777e95129d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf1c34206e4f72af335710c9c2d3178039057208b8a123d640e2a270bb48e19c1a205c8ce41e18a0bc2b5d58b2c8bc33a37a5052d706d44d9b6035548a0e62e
|
7
|
+
data.tar.gz: e08fb4973bacb416395934631f63b8d4e293fa73d6e7a360b1126d4403851e73084aa6443ab979b1070a090faebb4919a27d2d61c0461fd156f3e82a28a5179f
|
@@ -5,24 +5,24 @@ class JekyllOgImage::Generator < Jekyll::Generator
|
|
5
5
|
|
6
6
|
def generate(site)
|
7
7
|
base_path = File.join(
|
8
|
-
site.config["source"],
|
9
8
|
JekyllOgImage.config.output_dir,
|
10
9
|
"posts"
|
11
10
|
)
|
12
11
|
|
13
|
-
FileUtils.mkdir_p base_path
|
12
|
+
FileUtils.mkdir_p File.join(site.config["source"], base_path)
|
14
13
|
|
15
14
|
site.posts.docs.each do |post|
|
16
|
-
path = File.join(base_path, "#{post.data['slug']}.png")
|
15
|
+
path = File.join(site.config["source"], base_path, "#{post.data['slug']}.png")
|
17
16
|
|
18
17
|
if !File.exist?(path) || JekyllOgImage.config.force?
|
18
|
+
Jekyll.logger.info "Jekyll Og Image:", "Generating image #{path}"
|
19
19
|
generate_image_for_post(site, post, path)
|
20
20
|
else
|
21
|
-
Jekyll.logger.info "Jekyll Og Image:", "Skipping image generation
|
21
|
+
Jekyll.logger.info "Jekyll Og Image:", "Skipping image generation #{path} as it already exists."
|
22
22
|
end
|
23
23
|
|
24
24
|
post.data["image"] ||= {
|
25
|
-
"path" =>
|
25
|
+
"path" => File.join(base_path, "#{post.data['slug']}.png"),
|
26
26
|
"width" => 1200,
|
27
27
|
"height" => 600,
|
28
28
|
"alt" => post.data["title"]
|
data/lib/jekyll_og_image.rb
CHANGED