[#604] Add some handy filters
This commit is contained in:
parent
cc0526cb27
commit
fe6a79ac17
|
@ -1,4 +1,5 @@
|
|||
require 'chili_project/liquid/liquid_ext'
|
||||
require 'chili_project/liquid/filters'
|
||||
require 'chili_project/liquid/tags'
|
||||
|
||||
module ChiliProject
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
module ChiliProject
|
||||
module Liquid
|
||||
module Filters
|
||||
def default(input, default)
|
||||
input.to_s.strip.present? ? input : default
|
||||
end
|
||||
|
||||
def strip(input)
|
||||
input.to_s.strip
|
||||
end
|
||||
end
|
||||
|
||||
Template.register_filter(Filters)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue