jekyll-kw-shorten 0.0.8 → 0.0.9

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: bb2cbbc69a7c6412f1a4b27a513beb32a3f660f5277d5d5f33703c67581d5add
4
- data.tar.gz: dffc3d98ce15f1c6f974bbd66ca547c18ca368ef3caebcd424a7a1a67219a6a9
3
+ metadata.gz: 97496aede7c98b125cb9e846af73359d5fbc9bf7a1d2bf64209cd1b029e2a8c8
4
+ data.tar.gz: f10ea06d240481bbf7dc057ea48bd30a915d23a1df0c20a4faedd276d9879475
5
5
  SHA512:
6
- metadata.gz: 4f0e2d28dac1294c1349e39c3d3b7def088a24aae1949a64ae9b418bb14deee5b948abc8ca1edf33357fd6e26fea42d5c1764c6b5ee73c144a8d1075934ca214
7
- data.tar.gz: 7af4c26d2f71c4fa8566eb44fceaafe0606aac1855f8abc268c178943adb0f17f4261064c63f215f048872640852a03ff0103dbac9c5e3c05411559fb0cef931
6
+ metadata.gz: dbe3c662114d8a867b4e1ed5718215a62826eb35e3e08934fdf460a967757ec00f2b35283a2411e551796b69c2aae0b093cd38e5aa081e8235fbd284acda348a
7
+ data.tar.gz: 0112cb09a60e5dc1bf4d7a9f9de3a035ed178dcbac030fe2d8f5e5924fc79205d8284907ace1a0175f954acad24e56a2a7e42651a3b3bc3aa53a71983085eba9
@@ -11,9 +11,21 @@ module Jekyll
11
11
 
12
12
  # shorten tag {% shorten input %} for Jekyll
13
13
  class ShortenTag < Liquid::Tag
14
+
15
+ class << self
16
+ def tag_name
17
+ name.split("::").last.downcase
18
+ end
19
+ end
20
+
14
21
  def initialize(tag_name, input, tokens)
15
22
  super
16
23
  @input = input
24
+
25
+ # raise ArgumentError, <<~MSG
26
+ # Could not use '#{input}' in tag '#{self.class.tag_name}'.
27
+ # Make sure it is a string or a number.
28
+ # MSG
17
29
  end
18
30
 
19
31
  def render(context)
@@ -24,7 +36,11 @@ module Jekyll
24
36
  private
25
37
 
26
38
  def get_plugin_config(context)
27
- context.registers[:site].config[Jekyll::KargWare::Shorten::RUBYGEM_NAME] || {}
39
+ if defined? context.registers[:site].config
40
+ context.registers[:site].config[Jekyll::KargWare::Shorten::RUBYGEM_NAME] || {}
41
+ else
42
+ {}
43
+ end
28
44
  end
29
45
  end
30
46
 
@@ -38,7 +54,11 @@ module Jekyll
38
54
  private
39
55
 
40
56
  def get_plugin_config
41
- @context.registers[:site].config[Jekyll::KargWare::Shorten::RUBYGEM_NAME] || {}
57
+ if defined? @context.registers[:site].config
58
+ @context.registers[:site].config[Jekyll::KargWare::Shorten::RUBYGEM_NAME] || {}
59
+ else
60
+ {}
61
+ end
42
62
  end
43
63
  end
44
64
 
@@ -4,7 +4,7 @@ module Jekyll
4
4
  module KargWare
5
5
  module Shorten
6
6
  RUBYGEM_NAME = 'jekyll-kw-shorten'
7
- VERSION = '0.0.8'
7
+ VERSION = '0.0.9'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-kw-shorten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Karg