jekyll-og-image 1.5.0 → 1.6.0
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 +2 -0
- data/lib/jekyll_og_image/configuration.rb +2 -2
- data/lib/jekyll_og_image/generator.rb +3 -3
- data/lib/jekyll_og_image/version.rb +1 -1
- 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: 7eaa43e9e984aefab405ab170aef846da58afe0dc6bf1412e5fd9b636fe8b4c7
|
4
|
+
data.tar.gz: 4266e706d4b3a5fbae71b693223e2a3e9bc9fedc5c871c5d11cb2cf2ec1fb863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c478ecd6a8c6a4182b8d6c0bca7f3cf8518982c56a41c3d0365a21ff79bcc322e0990b4a3f1f6af86ca3d05bd358c2cc1ec065dbbb9cdd5e20d69cedbb32c7d
|
7
|
+
data.tar.gz: 493a88fae8b56c653e7968d2f9a4e1d4e406e3559ced57438d4be93fce146f8c668f4aa7e1b2991a612f79f7f651b69bcd8bad8d57165467bd2b14d8086db32e
|
data/README.md
CHANGED
@@ -44,6 +44,8 @@ The following configuration options are available:
|
|
44
44
|
* `canvas` – The canvas configuration options:
|
45
45
|
* `background_color` – The background color of the canvas. Default: `#FFFFFF`
|
46
46
|
* `background_image` – The background image of the canvas. Default: `nil`
|
47
|
+
* `width` – The width of the generated image in pixels. Default: `1200`
|
48
|
+
* `height` – The height of the generated image in pixels. Default: `600`
|
47
49
|
|
48
50
|
* `header` – The header configuration options:
|
49
51
|
* `font_family` – The font family of the header text. Default: `Helvetica, Bold`
|
@@ -3,8 +3,8 @@
|
|
3
3
|
# require "anyway_config"
|
4
4
|
|
5
5
|
class JekyllOgImage::Configuration
|
6
|
-
Canvas = Data.define(:background_color, :background_image) do
|
7
|
-
def initialize(background_color: "#FFFFFF", background_image: nil)
|
6
|
+
Canvas = Data.define(:background_color, :background_image, :width, :height) do
|
7
|
+
def initialize(background_color: "#FFFFFF", background_image: nil, width: 1200, height: 600)
|
8
8
|
super
|
9
9
|
end
|
10
10
|
end
|
@@ -50,8 +50,8 @@ class JekyllOgImage::Generator < Jekyll::Generator
|
|
50
50
|
|
51
51
|
item.data["image"] ||= {
|
52
52
|
"path" => relative_image_path,
|
53
|
-
"width" =>
|
54
|
-
"height" =>
|
53
|
+
"width" => JekyllOgImage.config.canvas.width,
|
54
|
+
"height" => JekyllOgImage.config.canvas.height,
|
55
55
|
"alt" => item.data["title"]
|
56
56
|
}
|
57
57
|
end
|
@@ -93,7 +93,7 @@ class JekyllOgImage::Generator < Jekyll::Generator
|
|
93
93
|
File.exist?(bg_path) ? File.read(bg_path) : nil
|
94
94
|
end
|
95
95
|
|
96
|
-
JekyllOgImage::Element::Canvas.new(
|
96
|
+
JekyllOgImage::Element::Canvas.new(JekyllOgImage.config.canvas.width, JekyllOgImage.config.canvas.height,
|
97
97
|
background_color: config.canvas.background_color,
|
98
98
|
background_image: background_image
|
99
99
|
)
|