···11+---
22+"starlight-sidebar-topics-dropdown-docs": major
33+---
44+55+Update to Astro 5 and Starlight 0.30 + Starlight Cooler Credit Dependency
+11
.changeset/cold-paws-pull.md
···11+---
22+"starlight-sidebar-topics-dropdown": minor
33+---
44+55+Adds support for Astro v5, drops support for Astro v4.
66+77+⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.30.0`.
88+99+Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0) to update your project.
1010+1111+Note that the [`legacy.collections` flag](https://docs.astro.build/en/reference/legacy-flags/#collections) is not supported by this plugin and you should update your collections to use Astro's new Content Layer API.
···14141515## Configure content collections
16161717-Starlight is built on top of Astro's [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content/config.ts` file.
1717+Starlight is built on top of Astro's [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content.config.ts` file.
18181919To add support for unlisted content pages, update the content config file to add support for associating content pages with a specific topic:
20202121```diff lang=ts ins="{ extend: topicSchema }"
2222-// src/content/config.ts
2222+// src/content.config.ts
2323import { defineCollection } from 'astro:content'
2424+import { docsLoader } from '@astrojs/starlight/loaders'
2425import { docsSchema } from '@astrojs/starlight/schema'
2526+import { topicSchema } from 'starlight-sidebar-topics/schema'
26272728export const collections = {
2828- docs: defineCollection({ schema: docsSchema({ extend: topicSchema }) }),
2929+ docs: defineCollection({
3030+ loader: docsLoader(),
3131+ schema: docsSchema({ extend: topicSchema })
3232+ }),
2933}
3034```
3135
···77import { throwPluginError } from '../lib/plugin'
88import { getCurrentTopic, type Topic } from '../lib/sidebar'
991010-const { entry, sidebar, slug } = Astro.props
1010+const { id, entry, sidebar } = Astro.props
11111212let currentSidebar = sidebar
1313let currentTopic: Topic | undefined = undefined
14141515if (entry['data'].template !== 'splash') {
1616- currentTopic = getCurrentTopic(config, sidebar, slug, entry)
1616+ currentTopic = getCurrentTopic(config, sidebar, id, entry)
1717 if (!currentTopic)
1818 throwPluginError(
1919- `Failed to find the topic for the \`${slug}\` page.`,
1919+ `Failed to find the topic for the \`${id}\` page.`,
2020 `Either include this page in the sidebar configuration of the desired topic using the \`items\` property or to associate an unlisted page with a topic, use the \`topic\` frontmatter property and set it to the desired topic ID.
2121Learn more about unlisted pages in the ["Unlisted pages"](https://starlight-sidebar-topics.netlify.app/docs/guides/unlisted-pages/) guide.`,
2222 )