diff --git a/MIGRATION.md b/MIGRATION.md deleted file mode 100644 index fb61924d..00000000 --- a/MIGRATION.md +++ /dev/null @@ -1,27 +0,0 @@ -## Migration guides - -### From `<= 1.0.0-alpha.10` - -Url alias will be disabled by default for all content types. Make sure to enable it for the content types you need url alias enabled for. - -You have to options to do this: - -#### Option 1 - -Stay in version `1.0.0-alpha.10` and run the development server. Go to the admin panel -> content type builder. Now select the content types you want url alias enabled for and click Edit -> Advanced settings -> Url alias. This will enable url alias for that specific content type. - -#### Options 2 - -Update the content type schema files `schema.json` in your code that you want url alias enabled for and add the following: - -```jsonc -{ - // ... - "pluginOptions": { - "url-alias": { - "enabled": true - } - } - // ... -} -``` diff --git a/README.md b/README.md index 8025a5af..9784d40f 100644 --- a/README.md +++ b/README.md @@ -107,12 +107,6 @@ await fetch(`${API_URL}/api/url-alias/get?path=/about-page`); // GET /api/url-alias/get?path=/about-page ``` -## Migration guides - -See [MIGRATION.md](./MIGRATION.md) - - - ## 🔗 Links - [NPM package](https://www.npmjs.com/package/@strapi-community/strapi-plugin-url-alias) diff --git a/lib/schemas/pluginOptions.ts b/lib/schemas/pluginOptions.ts index f22b06d6..fa606c16 100644 --- a/lib/schemas/pluginOptions.ts +++ b/lib/schemas/pluginOptions.ts @@ -3,7 +3,7 @@ import { object, boolean, InferType } from "yup"; export const pluginOptionsSchema = object({ - enabled: boolean().default(false), + enabled: boolean().default(true), }); export type PluginOptions = InferType; diff --git a/server/util/enabledContentTypes.ts b/server/util/enabledContentTypes.ts index 268b2032..1baea8c0 100644 --- a/server/util/enabledContentTypes.ts +++ b/server/util/enabledContentTypes.ts @@ -10,7 +10,7 @@ export const isContentTypeEnabled = (uid: string) => { if (isInContentManager === false) return false; const urlAliasPluginOptionsRaw = _.get(pluginOptions, [pluginId], {}); - const urlAliasOptions = pluginOptionsSchema.cast(urlAliasPluginOptionsRaw); + const urlAliasOptions = pluginOptionsSchema.cast(urlAliasPluginOptionsRaw ); if (!urlAliasOptions.enabled) return false;