Method: Jekyll::PaginateV2::Generator::Utils.ensure_leading_slash
- Defined in:
- lib/jekyll-paginate-v2/generator/utils.rb
.ensure_leading_slash(path) ⇒ Object
Static: Return a String version of the input which has a leading slash.
If the input already has a forward slash in position zero, it will be
returned unchanged.
path - a String path
Returns the path with a leading slash
54 55 56 |
# File 'lib/jekyll-paginate-v2/generator/utils.rb', line 54 def self.ensure_leading_slash(path) path[0..0] == "/" ? path : "/#{path}" end |