0.0
No release in over 3 years
Low commit activity in last 3 years
An extension to Ruby's `String` class that adds Jekyll-style `#slugify` method.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0.2
~> 13.0
~> 3.8
~> 0.76.0
~> 0.17.0
~> 0.9.20

Runtime

>= 1.6, < 2
 Project Readme

jekyll_slugify

Gem License Contributor Covenant

Travis (.org) Code Climate maintainability Code Climate coverage Libraries.io dependency status for GitHub repo

An extension to Ruby's String class that adds Jekyll-style #slugify method.

Installing

  1. Add jekyll_slugify to dependencies:
    1. Gemfile: gem 'jekyll_slugify', '~> VERSION'; or
    2. gemspec file: spec.add_dependency 'jekyll_slugify', '~> VERSION';
  2. Run bundle install to fetch the gem from RubyGems;
  3. Require the gem on your code: require 'jekyll_slugify'
  4. Apply the #slugify method on a string:
@foo = 'Hello Worlds!'
puts @foo.slugify
    => hello-worlds

Do note, however, that the slugify method will not work on ideograms - an ideogram-only word will actually raise an error!

puts 'Ærøskøbing'.slugify # Works
    => aeroskobing

puts '指事字'.slugify # Raises a Runtime error
    => Empty `slug` generated for given String (RuntimeError)

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request 🎉

Please, also read our Contributing Guidelines.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

History & Versioning

See the Change Log for further history.

This project uses SemVer for versioning. For the versions available, see the tags on this repository.

Legal Stuff

MIT License

This project is available under the MIT License.

The code on this project is adapted from Jekyll's Utils#slugify method, available under the same MIT License.