fenton-jekyll-plugin 0.0.10 → 0.0.12
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: 47a94753e8a3df67146200bc37f52657d47af9472d9d75fad3ce252bebdf7d3a
|
4
|
+
data.tar.gz: 9a21c1f6c46e87312294505deb0c95070ca9fc7156c0184ef9824aadfe45006e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11a5cbe5b84d8951efffe07ebc62780ca09f8c87e8f3117a3fe25b869547f74b28ea18281300c5ae4465df381bcce35fe3af4b37b55284519dda50f0c29d3e43
|
7
|
+
data.tar.gz: 63cf4b9f44d80c4c4d34968350e37d947f40d0e965411acaa01c093a462d6c4abcf34f1b9db209a0b0fb7e972a6a3dc68e3e01e221a102cd29fc4bc9a2785a08
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'liquid'
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
module IsNIl
|
5
|
+
def isnil(val, default)
|
6
|
+
if [true, false].include? val
|
7
|
+
return val
|
8
|
+
end
|
9
|
+
|
10
|
+
if val == nil
|
11
|
+
return default
|
12
|
+
end
|
13
|
+
|
14
|
+
if val.is_a? String and val.strip == ''
|
15
|
+
return default
|
16
|
+
end
|
17
|
+
|
18
|
+
return val
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Liquid::Template.register_filter(Jekyll::IfNIl)
|
data/lib/fenton-jekyll-plugin.rb
CHANGED
@@ -3,7 +3,7 @@ require "fenton-jekyll-plugin/jb_jekyll_markdown"
|
|
3
3
|
require "fenton-jekyll-plugin/jb_jekyll_paging"
|
4
4
|
require "fenton-jekyll-plugin/jb_liquid_language"
|
5
5
|
require "fenton-jekyll-plugin/jb_liquid_regex"
|
6
|
-
require "fenton-jekyll-plugin/
|
6
|
+
require "fenton-jekyll-plugin/jb_liquid_isnil"
|
7
7
|
|
8
8
|
module Jekyll
|
9
9
|
module Fenton
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fenton-jekyll-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Fenton
|
@@ -61,7 +61,7 @@ files:
|
|
61
61
|
- lib/fenton-jekyll-plugin/jb_jekyll_breadcrumbs.rb
|
62
62
|
- lib/fenton-jekyll-plugin/jb_jekyll_markdown.rb
|
63
63
|
- lib/fenton-jekyll-plugin/jb_jekyll_paging.rb
|
64
|
-
- lib/fenton-jekyll-plugin/
|
64
|
+
- lib/fenton-jekyll-plugin/jb_liquid_isnil.rb
|
65
65
|
- lib/fenton-jekyll-plugin/jb_liquid_language.rb
|
66
66
|
- lib/fenton-jekyll-plugin/jb_liquid_regex.rb
|
67
67
|
- lib/fenton-jekyll-plugin/version.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'liquid'
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module IfNIl
|
5
|
-
def isnil(val, default)
|
6
|
-
if val == nil
|
7
|
-
return default
|
8
|
-
else
|
9
|
-
return val
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def isnil_or_empty(val, default)
|
14
|
-
if val == nil || val.blank
|
15
|
-
return default
|
16
|
-
else
|
17
|
-
return val
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Liquid::Template.register_filter(Jekyll::IfNIl)
|