SEO-friendly URL Slug Generator With jQuery - Slugger

SEO-friendly URL Slug Generator With jQuery - Slugger
File Size: 6.75 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Slugger is a jQuery plugin which automatically converts your post/article titles into semantic, SEO-friendly URL slugs with prefix and suffix support.

How to use it:

1. Place the jQuery slugger plugin after jQuery library but before you close the body tag.

<script src="//code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="dist/slugger.js"></script>

2. Create an input field to accept post/article titles.

<input type="text" name="postTitle" id="postTitle">

3. Create another input field to output the url slugs.

<input type="text" name="permalink" id="permalink">

4. Enable the plugin.

$('#permalink').slugger({
  source: '#postTitle'
});

5. Add custom suffix and/or prefix to the URL slugs.

$('#permalink').slugger({
  source: '#postTitle',
  prefix: 'jQuery',
  suffix:'script'
});

6. Make the slug input field read only.

$('#permalink').slugger({
  source: '#postTitle',
  prefix: 'jQuery',
  suffix:'script',
  readonly: true
});

Change log:

2016-11-02

  • added more character support

This awesome jQuery plugin is developed by dadigu. For more Advanced Usages, please check the demo page or visit the official website.