jekyll-kw-shorten 0.0.2 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb27dde8ac5b0e129bea77504f4d60f5056362c057cc1d3ac60b79641eca3199
|
4
|
+
data.tar.gz: 72952c2ef3477374858a7069be47100f687bc8cc67ea0a02c7ca8ccbdeeb1e8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db034eb7c07fdc09713dc54279048e78663d22e15a98daca06821cc177329d3eb33c0115972100a7c6025a134eea3377ca11db66eba3feb84fb165cb41a1636
|
7
|
+
data.tar.gz: 6a544ec6995693777fbf6d607510163ee09520aaeaed34c0484396b0a174bae1ee82e5d8eec24eda781e59c0955977a3af8c4bd500594dccd84c310291ab8843
|
data/lib/jekyll-kw-shorten.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'jekyll/KargWare/Shorten/parser'
|
4
|
+
|
3
5
|
module Jekyll
|
4
6
|
module KargWare
|
5
7
|
module Shorten
|
@@ -8,14 +10,15 @@ module Jekyll
|
|
8
10
|
|
9
11
|
# shorten tag {% shorten input %} for Jekyll
|
10
12
|
class ShortenTag < Liquid::Tag
|
13
|
+
include Jekyll::KargWare::Shorten::ShortenFilter
|
14
|
+
|
11
15
|
def initialize(tag_name, input, tokens)
|
12
16
|
super
|
13
17
|
@input = input
|
14
18
|
end
|
15
19
|
|
16
20
|
def render(context)
|
17
|
-
|
18
|
-
filter.shorten(@input)
|
21
|
+
shorten(@input)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
@@ -5,7 +5,7 @@ module Jekyll
|
|
5
5
|
module Shorten
|
6
6
|
# Shorten configuration class
|
7
7
|
class Configuration
|
8
|
-
|
8
|
+
attr_reader :shorten_gt3_digit, :shorten_gt6_digit, :shorten_gt9_digit
|
9
9
|
|
10
10
|
DEFAULT_CONFIG = {
|
11
11
|
'shorten_gt3_digit' => ' K',
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'jekyll/KargWare/Shorten/configuration'
|
4
|
+
|
3
5
|
module Jekyll
|
4
6
|
module KargWare
|
5
7
|
module Shorten
|
@@ -8,7 +10,7 @@ module Jekyll
|
|
8
10
|
attr_reader :configuration
|
9
11
|
|
10
12
|
def initialize(options = {})
|
11
|
-
@configuration = Configuration.new(options)
|
13
|
+
@configuration = Jekyll::KargWare::Shorten::Configuration.new(options)
|
12
14
|
end
|
13
15
|
|
14
16
|
def shorten(text)
|