1
0
mirror of https://github.com/bitwarden/help synced 2025-12-06 00:03:30 +00:00

alert and callout plugins

This commit is contained in:
Kyle Spearrin
2017-05-22 23:33:54 -04:00
parent 17e296adf7
commit 77b80c6e7f
7 changed files with 116 additions and 44 deletions

20
_plugins/pluralize.rb Normal file
View File

@@ -0,0 +1,20 @@
# pluralize
#
# A Liquid filter to make it easy to form correct plurals.
#
# https://github.com/bdesham/pluralize
module Pluralize
def pluralize(number, singular, plural = nil)
number = number.to_i
if number == 1
"#{singular}"
elsif plural.nil?
"#{singular}s"
else
"#{plural}"
end
end
end
Liquid::Template.register_filter(Pluralize)