Skip to content

The stringToSlug converts any string to SLUG (known as spinal-case or kebab-case). Or other (snake_case, PascalCase, ...) in any Languages. Having or not special characters (ã,é,í,ü,ñ...)

License

Notifications You must be signed in to change notification settings

leocaseiro/jQuery-Plugin-stringToSlug

Repository files navigation

jQuery plugin stringToSlug Bower version Build Status

A simple plugin in jQuery to create a URL. The stringToSlug converts string in any language, including those with accents and special characters, to a SLUG.

Documentation

Full documentation with examples at http://leocaseiro.github.io/jQuery-Plugin-stringToSlug/

Default Usage:

$(document).ready( function() {
    $("#string").stringToSlug();
});

Install via Bower:

bower install --save jquery.stringtoslug

Click here to download the latest version

Description

The stringToSlug uses a third-party library called speakingURL that removes special characters and converts the string to lowercase. The StringToSlug replaces spaces with space characters(separators) and offers the option to add a prefix and/or a suffix for your slug.

In order to transform a string into a url-friendly permalink, use the plugin to display a preview in a html element or in an input form.

Contributing

The StringToSlug uses NodeJS with NPM and Gulp to compile a code, and QUnit and Karma for testing:

To install Bower and Gulp globally, use npm install -g:

npm install bower -g
npm install gulp -g

Download and install all dependencies with NPM and make sure Bower is up to date:

npm install
bower install

List all tasks with Gulp

gulp

Watch all files with gulp watcher to develop and test in realtime

gulp watcher

Use gulp tests for testing

gulp tests

Use gulp build to compile

gulp build

License

Copyright (c) 2009-2018 Leo Caseiro. This is free software and is licensed under the MIT License.

Created and maintained by Leo Caseiro

About

The stringToSlug converts any string to SLUG (known as spinal-case or kebab-case). Or other (snake_case, PascalCase, ...) in any Languages. Having or not special characters (ã,é,í,ü,ñ...)

Resources

License

Stars

Watchers

Forks

Packages

No packages published