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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 260918d98e574361037584e4d0d4097dd41fdcd3526386d3abfde00e2dc4b0f6
4
- data.tar.gz: e0c75eec8ddb3f3911aac2ef2b45687ecc1bb036057ed183802570a82f1a4922
3
+ metadata.gz: 7eaa43e9e984aefab405ab170aef846da58afe0dc6bf1412e5fd9b636fe8b4c7
4
+ data.tar.gz: 4266e706d4b3a5fbae71b693223e2a3e9bc9fedc5c871c5d11cb2cf2ec1fb863
5
5
  SHA512:
6
- metadata.gz: 16f6da984ff3821513fdfd51eb9beb06e45bfb76c4530464ebc2f7d9164985a4583ec894258580ea125aed96b9ea489acc55332adc920cfda64e7f9f4c7ec3ee
7
- data.tar.gz: eb147ebfeb11d50a80370ced4b82b33c1b33730c6b087c3eddc2871b6aed570dac8014cd01f687711b4f316cdf51bb9cf37cbb8eb82b58e048bafa8f3a21bcac
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" => 1200,
54
- "height" => 600,
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(1200, 600,
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
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllOgImage
4
- VERSION = "1.5.0"
4
+ VERSION = "1.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-og-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov