Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuxtclub/slugify
An easy way to integrate Slugify with NuxtJS
https://github.com/nuxtclub/slugify
nuxt nuxt-module nuxt-modules nuxtjs supabase supabase-js
Last synced: 4 months ago
JSON representation
An easy way to integrate Slugify with NuxtJS
- Host: GitHub
- URL: https://github.com/nuxtclub/slugify
- Owner: nuxtclub
- License: mit
- Created: 2021-08-13T00:01:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-23T19:04:11.000Z (over 2 years ago)
- Last Synced: 2023-12-19T17:14:18.224Z (about 1 year ago)
- Topics: nuxt, nuxt-module, nuxt-modules, nuxtjs, supabase, supabase-js
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @nuxtclub/slugify
## Setup
1. Add `@nuxtclub/slugify` dependency to your project
```bash
yarn add -D @nuxtclub/slugify # or npm i -D @nuxtclub/slugify
```2. Add `@nuxtclub/slugify` to the `buildModules` section of `nuxt.config.js`.
:warning: If you are using Nuxt **< v2.9** you have to install the module as a `dependency` (No `--dev` or `--save-dev` flags) and use `modules` section in `nuxt.config.js` instead of `buildModules`.
```javascript
export default {
buildModules: ['@nuxtclub/slugify'],
}
```## Globals
You can add global/default options:
```javascript
export default {
buildModules: ['@nuxtclub/slugify'],
slugify: {
globals: {
lower: true,
},
},
}
```## Extend Slugify
You can extend the supported symbols, or override the existing ones with your own:
```javascript
// nuxt.config.js
export default {
buildModules: ['@nuxtclub/slugify'],
slugify: {
extend: {
'@': 'at',
},
},
}
```## Typescript support
Add the types to your `"types"` array in `tsconfig.json` after the `@nuxt/types` entry.
:warning: Use `@nuxt/vue-app` instead of `@nuxt/types` for nuxt < 2.9.
```json
{
"compilerOptions": {
"types": ["@nuxt/types", "@nuxtclub/slugify"]
}
}
```## Usage
This module will inject \$slugify in the context of your application.
Learn more about Slugify [here](https://github.com/simov/slugify)