coryzibell / nanoslugs
Generates a nanoid for new entry slugs.
Installs: 2 229
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0-RC1
- hidehalo/nanoid-php: ^1.1.4
README
Nanoslugs is a Craft plugin that sets the slug of a new entry to be a nanoid.
This plugin copies heavily from Madhouses's Slugger plugin that does something very similar using a different library. Thanks, Madhouse. ๐ Their plugin copies heavily from Alec Ritson's Slugged plugin for Craft 2. Thanks, Alec. ๐ (The section override works in this version btw.)
Requirements
This plugin requires Craft CMS 3.0.0 or later.
Installation
Visit the Plugin Store in your Craft 3 control panel and install from there. Nanoslugs costs nothing. Visit the Plugin Store in your Craft 3 control panel. It costs nothing.
Or...
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require coryzibell/nanoslugs
-
In the Control Panel, go to Settings โ Plugins and click the โInstallโ button for Nanoslugs.
Configuration
All configuration is done in the plugin settings page in the admin area.
Plugin settings
Default length The length of the hash, this will be overwritten with any length defined for a section
Default: 8
Alphabet The characters to use when generating the slug.
Default: 0123456789abcdefghijklmnopqrstuvwxyz-
Sections The only sections that will be listed are editable sections (no singles obvs). If you add a length to a section this will override the default set above. A section must be enabled for the hashing to happen, regardless of whether you add a length override or not.
Using Nanoslugs
Enable your section in the settings. Make a new entry. Save it. Voila... cryptographically secure slug.
Support, issues, feedback
If you experience any problems please create a new issue here on the repo.