Add a plugin to capitalize every word
This commit is contained in:
parent
1cf3472b0b
commit
2a72ff3658
1 changed files with 11 additions and 0 deletions
11
_plugins/_capitalize_all.rb
Normal file
11
_plugins/_capitalize_all.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
require 'liquid'
|
||||||
|
require 'uri'
|
||||||
|
|
||||||
|
# Capitalize all words of the input
|
||||||
|
module CapitalizeAll
|
||||||
|
def capitalize_all(words)
|
||||||
|
return words.split(' ').map(&:capitalize).join(' ')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_filter(CapitalizeAll)
|
Reference in a new issue