From 2a72ff3658487c0a826b8e13e2c87cefd8db4beb Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 10 May 2015 00:23:40 +0200 Subject: [PATCH] Add a plugin to capitalize every word --- _plugins/_capitalize_all.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 _plugins/_capitalize_all.rb diff --git a/_plugins/_capitalize_all.rb b/_plugins/_capitalize_all.rb new file mode 100644 index 0000000..87850aa --- /dev/null +++ b/_plugins/_capitalize_all.rb @@ -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)