1
0
Fork 0
blog.kempkens.io/_plugins/hostname.rb

12 lines
211 B
Ruby

require 'uri'
module Jekyll
module HostnameFilter
def hostname(input)
parsed_uri = URI.parse(input)
parsed_uri.host
end
end
end
Liquid::Template.register_filter(Jekyll::HostnameFilter)