|
1 | 1 | # starlight-sidebar-topics-dropdown |
2 | 2 |
|
| 3 | +## 0.5.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#40](https://github.com/trueberryless-org/starlight-sidebar-topics-dropdown/pull/40) [`acf6f15`](https://github.com/trueberryless-org/starlight-sidebar-topics-dropdown/commit/acf6f156d4e8eaa00b2205dbb89befbd5dea27c7) Thanks [@trueberryless](https://github.com/trueberryless)! - ⚠️ **BREAKING CHANGE:** This plugin now uses the [Starlight Sidebar Topics](https://starlight-sidebar-topics.netlify.app/) plugin as a peer dependency. Please follow the upgrade guide below to migrate to the new version. |
| 8 | + |
| 9 | + 1. Install the [Starlight Sidebar Topics](https://starlight-sidebar-topics.netlify.app/) plugin: |
| 10 | + |
| 11 | + ```sh |
| 12 | + npm i starlight-sidebar-topics |
| 13 | + ``` |
| 14 | + |
| 15 | + 2. Update the `starlight-sidebar-topics-dropdown` plugin in your `astro.config.mjs` (use the `starlight-sidebar-topics` plugin instead): |
| 16 | + |
| 17 | + ```diff lang="js" |
| 18 | + // astro.config.mjs |
| 19 | + -import starlightSidebarTopicsDropdown from "starlight-sidebar-topics-dropdown"; |
| 20 | + +import starlightSidebarTopics from "starlight-sidebar-topics"; |
| 21 | + ``` |
| 22 | + |
| 23 | + 3. Exchange the `starlight-sidebar-topics-dropdown` plugin with the `starlight-sidebar-topics` plugin and add a manual override for the `Sidebar` component where you can use the dropdown component from the `starlight-sidebar-topics-dropdown` plugin: |
| 24 | + |
| 25 | + ```diff lang="js" |
| 26 | + // astro.config.mjs |
| 27 | + export default defineConfig({ |
| 28 | + integrations: [ |
| 29 | + starlight({ |
| 30 | + plugins: [ |
| 31 | + - starlightSidebarTopicsDropdown([ |
| 32 | + + starlightSidebarTopics([ |
| 33 | + // Your Starlight Sidebar Topics configuration here (unchanged). |
| 34 | + ]), |
| 35 | + ], |
| 36 | + + components: { |
| 37 | + + Sidebar: './src/components/Sidebar.astro', |
| 38 | + + }, |
| 39 | + }), |
| 40 | + ], |
| 41 | + }); |
| 42 | + ``` |
| 43 | +
|
| 44 | + 4. Create an Astro component to replace the default Starlight `<Sidebar>` component with which will render the topic list dropdown menu and [re-use the default Starlight sidebar](https://starlight.astro.build/guides/overriding-components/#reuse-a-built-in-component): |
| 45 | +
|
| 46 | + ```astro |
| 47 | + --- |
| 48 | + // src/components/Sidebar.astro |
| 49 | + import Default from "@astrojs/starlight/components/Sidebar.astro"; |
| 50 | + import TopicsDropdown from "starlight-sidebar-topics-dropdown/TopicsDropdown.astro"; |
| 51 | + --- |
| 52 | +
|
| 53 | + {/* Render the topics dropdown menu. */} |
| 54 | + <TopicsDropdown /> |
| 55 | + {/* Render the default sidebar. */} |
| 56 | + <Default><slot /></Default> |
| 57 | + ``` |
| 58 | +
|
| 59 | + 5. Update the schema import in `src/content.config.ts`: |
| 60 | +
|
| 61 | + ```diff lang="ts" |
| 62 | + // src/content.config.ts |
| 63 | + -import { topicSchema } from "starlight-sidebar-topics-dropdown/schema"; |
| 64 | + +import { topicSchema } from "starlight-sidebar-topics/schema"; |
| 65 | + ``` |
| 66 | +
|
3 | 67 | ## 0.4.1 |
4 | 68 |
|
5 | 69 | ### Patch Changes |
|
0 commit comments