@nuxtclub/slugify

An easy way to integrate Slugify with NuxtJS
2,516 4
Install
npm install @nuxtclub/slugify
Latest Version:1.2.1
License:MIT
Last Updated:Jul 23, 2022
Links: GitHub  ·  npm
Maintainer: imlautaro

@nuxtclub/slugify

Setup

  1. Add @nuxtclub/slugify dependency to your project
yarn add -D @nuxtclub/slugify # or npm i -D @nuxtclub/slugify
  1. 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.

export default {
	buildModules: ['@nuxtclub/slugify'],
}

Globals

You can add global/default options:

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:

// 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.

{
	"compilerOptions": {
		"types": ["@nuxt/types", "@nuxtclub/slugify"]
	}
}

Usage

This module will inject $slugify in the context of your application.

Learn more about Slugify here

Related Packages

nuxt-define

One utility function for module authors to define compiler constants for all bui...

13,412,511
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0
nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention

6,263,746 91
@bg-dev/nuxt-naiveui

Unofficial Naive UI module for Nuxt

144,316 187
@ztl-uwu/nuxt-content

Write your content inside your Nuxt app

34,108

Version History

Version Released License
1.2.1 MIT
1.2.0 MIT
1.1.0 MIT
1.0.0 MIT