jekyll-mahjong 2.0.0 → 2.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-mahjong.rb +5 -19
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1c9cdc30076e03d2ae202ce8bbb0a439dfce450b177b6c62eea11405bfcd408
4
- data.tar.gz: 475327ebc2bd56b87b4644577a1d2a08d49eac9b12be8d98dfeb903edb8a0dae
3
+ metadata.gz: be745538403f17b27a1a938774020f8f738792a9e88b4c5cc1c6094f83dc1706
4
+ data.tar.gz: 95e7ffe8abd43b84a9e4cd26ccae2732fb7b166b6614cd75ee00568d5ac4aeac
5
5
  SHA512:
6
- metadata.gz: d633e07a8fc90fead34ea91b6abf95d36ad7c429d0b38690cf8a1df7a93d7d345fcb1b6460979a3a61dda687e028323a1c5b7b16548292b0605e2a7c82f4272e
7
- data.tar.gz: bab3fb01a770b21c51e17f44a6c481dc743fa2d043671d6ff1ae2aac25ef62092166f2fa81b15c1c87c12ee51e418c3a44b501b523bccec9098900ba80ce3740
6
+ metadata.gz: 12af92282ab7ad553224916d8806d268b901fe930e9a63c119ad09195912c9c6527206c0d6a77393c7769cbd54f9e52c822e82c33cdee92cffbfc1f54b8dda10
7
+ data.tar.gz: bf41478ad16d8dcdd3c4f2a4e11120639fcf75aaa12fee33ff095637d0f09246a3e68719cb4d0de817dbca35345ab7492e6182558688dbb96d0251110a31e024
@@ -5,21 +5,6 @@ module JekyllMahjong
5
5
  def initialize(tag_name, input, tokens)
6
6
  super
7
7
  @input = input.strip
8
-
9
- @tile_size = 2
10
- @tile_margin_right = -@tile_size * 0.03
11
- @group_margin = @tile_size * 0.6
12
- end
13
-
14
- def read_config(context)
15
- config = context.registers[:site].config
16
-
17
- tile_size = config.dig('jekyll-mahjong', 'tile-size')
18
- if !tile_size.nil?
19
- @tile_size = tile_size
20
- @tile_margin_right = -@tile_size * 0.03
21
- @group_margin = @tile_size * 0.5
22
- end
23
8
  end
24
9
 
25
10
  def render(context)
@@ -27,8 +12,6 @@ module JekyllMahjong
27
12
  if @input.empty?
28
13
  return ""
29
14
  end
30
- # overwrite the defaults with `_config.yml` definitions if they exist
31
- read_config(context)
32
15
 
33
16
  # get the tile groups: "123p789s 1Z11z" => ["123p789s", "1Z11z"]
34
17
  tile_groups = @input.split(' ')
@@ -40,9 +23,12 @@ module JekyllMahjong
40
23
  for tile_group in tile_groups[1..-1]
41
24
  svg_group = svg_for_tile_group(tile_group)
42
25
 
43
- # do nothing if there are no tiles in the last group
26
+ # add group to the output unless the group is empty
44
27
  unless svg_group.empty?
45
- output += "<span class='space-between-tile-groups' />"
28
+ # add space between groups unless there is no previous group
29
+ unless output.empty?
30
+ output += "<span class='space-between-tile-groups' />"
31
+ end
46
32
  output += svg_group
47
33
  end
48
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-mahjong
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Gao