From 394eab4a3afc561f294c2c7212ab2680d244b6fe Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Sun, 7 Sep 2014 16:48:57 +0900 Subject: [PATCH] Add the slugify Liquid filter --- lib/jekyll/filters.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 2664a01f..bcdf80ff 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -47,6 +47,17 @@ module Jekyll converter.convert(input) end + # Slugify a filename or title. + # + # input - The filename or title to slugify. + # + # Returns the given filename or title as a lowercase String, with every + # sequence of spaces and non-alphanumeric characters replaced with a + # hyphen. + def slugify(input) + Utils.slugify(input) + end + # Format a date in short format e.g. "27 Jan 2011". # # date - the Time to format.