Created
October 1, 2021 23:54
-
-
Save inetbiz/04320fb0f822623e9c5bf69cdb3de84b to your computer and use it in GitHub Desktop.
Jekyll Custom Plugin to Capitalize All Words in a String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'liquid' | |
require 'uri' | |
# Capitalize all words of the input | |
module Jekyll | |
module CapitalizeAll | |
def capitalize_all(words) | |
return words.split(' ').map(&:capitalize).join(' ') | |
end | |
end | |
end | |
Liquid::Template.register_filter(Jekyll::CapitalizeAll) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment