mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Merge commit '87a5e747f'
This commit is contained in:
@@ -19,6 +19,21 @@ module Jekyll
|
||||
|
||||
def number_of_words(input)
|
||||
input.split.length
|
||||
end
|
||||
end
|
||||
|
||||
def array_to_sentence_string(array)
|
||||
connector = "and"
|
||||
case array.length
|
||||
when 0
|
||||
""
|
||||
when 1
|
||||
array[0].to_s
|
||||
when 2
|
||||
"#{array[0]} #{connector} #{array[1]}"
|
||||
else
|
||||
"#{array[0...-1].join(', ')}, #{connector} #{array[-1]}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user