Перейти к содержимому

Legacy flags

Это содержимое пока не доступно на вашем языке.

To help some users migrate between versions of Astro, we occasionally introduce legacy flags.

These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro in the latest version, so that you can continue to upgrade and take advantage of new Astro releases until you are able to fully update your project code.

Добавлено в: astro@6.0.0 Бета

The legacy.collectionsBackwardsCompat flag provides temporary backwards compatibility for projects unable to migrate to the Content Layer API introduced in v5.0.

astro.config.mjs
export default defineConfig({
legacy: {
collectionsBackwardsCompat: true,
},
});

This flag preserves some legacy v4 content collections features:

  • Supports type: 'content' and type: 'data' without loaders
  • Preserves legacy entry API: entry.slug and entry.render()
  • Uses path-based entry IDs instead of slug-based IDs

This is a temporary migration helper. Migrate collections to the Content Layer API, then disable this flag.

Внести свой вклад Сообщество Поддержать