middleman-social_image 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e367633b01f5990facae751ae7f5c615c240dfec330167cc5d632b726903c3ce
|
4
|
+
data.tar.gz: aeaf53cf8ac3b9bf8f3d36908d504038f31c2d070d6c4780a35454b57098797b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d5eae315f60e07165afa0ee33c2e7e9bcea9909a664c47f609654619c3251dbbb192a99c06285a4a8b7f20219fe49230711ecadb1ea767fed164a6c4bcf3899
|
7
|
+
data.tar.gz: 8ffab1b034b3d31b8296db23547d27c5753e69fd534634958efe67b0cb22ea9ceb4487b3a96bea65debfbd767124c76ea30bb0eb9ebd158bef3fe29c057ffa4f
|
data/README.md
CHANGED
@@ -28,7 +28,8 @@ activate :social_image do |social_image|
|
|
28
28
|
social_image.base_url = 'http://localhost:4567/' # Base URL of running middleman server
|
29
29
|
social_image.base_asset_dir = 'assets/images/social-images' # Where to save the generated images
|
30
30
|
social_image.social_image_url_pattern = %r{(/social-image)/$} # Screenshot URLs matching this pattern
|
31
|
-
social_image.social_image_url_substitution
|
31
|
+
social_image.social_image_url_substitution = '\1.png' # When generating screenshots, replace URLs matching social_image_url_pattern with this
|
32
|
+
social_image.selector = 'body > *' # Used to test that the social image url has loaded properly. The more specific this is, the better the chance of catching errors.
|
32
33
|
end
|
33
34
|
```
|
34
35
|
|
@@ -43,7 +43,12 @@ module Middleman
|
|
43
43
|
FileUtils.mkdir_p(File.dirname(image_path))
|
44
44
|
url = File.join(options.base_url, resource.url)
|
45
45
|
session.visit(url)
|
46
|
-
session.
|
46
|
+
if session.has_selector?(options.selector)
|
47
|
+
session.save_screenshot(image_path)
|
48
|
+
else
|
49
|
+
say "Aborting. #{image_path} did not contain '#{options.selector}'. Is the preview server running?"
|
50
|
+
exit
|
51
|
+
end
|
47
52
|
end
|
48
53
|
end
|
49
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-social_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul McMahon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|