|
| 1 | +// @ts-check |
| 2 | +import starlight from "@astrojs/starlight"; |
| 3 | +import { defineConfig } from "astro/config"; |
| 4 | +import { createStarlightTypeDocPlugin } from "starlight-typedoc"; |
| 5 | + |
| 6 | +const [coreStarlightTypeDoc, coreTypeDocSidebarGroup] = |
| 7 | + createStarlightTypeDocPlugin(); |
| 8 | +const [reactStarlightTypeDoc, reactTypeDocSidebarGroup] = |
| 9 | + createStarlightTypeDocPlugin(); |
| 10 | +const [vueStarlightTypeDoc, vueTypeDocSidebarGroup] = |
| 11 | + createStarlightTypeDocPlugin(); |
| 12 | +const [reactFullStarlightTypeDoc, reactFullTypeDocSidebarGroup] = |
| 13 | + createStarlightTypeDocPlugin(); |
| 14 | +const [lyricStarlightTypeDoc, lyricTypeDocSidebarGroup] = |
| 15 | + createStarlightTypeDocPlugin(); |
| 16 | + |
| 17 | +// https://astro.build/config |
| 18 | +export default defineConfig({ |
| 19 | + base: "applemusic-like-lyrics", |
| 20 | + integrations: [ |
| 21 | + starlight({ |
| 22 | + favicon: "favicon.ico", |
| 23 | + title: "Apple Music-like Lyrics", |
| 24 | + customCss: ["./src/styles/custom.css"], |
| 25 | + locales: { |
| 26 | + root: { |
| 27 | + label: "简体中文", |
| 28 | + lang: "zh-CN", |
| 29 | + }, |
| 30 | + en: { |
| 31 | + label: "English", |
| 32 | + lang: "en", |
| 33 | + }, |
| 34 | + }, |
| 35 | + social: { |
| 36 | + github: "https://github.com/Steve-xmh/applemusic-like-lyrics", |
| 37 | + }, |
| 38 | + plugins: [ |
| 39 | + coreStarlightTypeDoc({ |
| 40 | + entryPoints: ["../core/src/index.ts"], |
| 41 | + output: "reference/core", |
| 42 | + tsconfig: "../core/tsconfig.json", |
| 43 | + sidebar: { |
| 44 | + label: "core", |
| 45 | + collapsed: true, |
| 46 | + }, |
| 47 | + typeDoc: { |
| 48 | + exclude: ["test.ts"], |
| 49 | + }, |
| 50 | + }), |
| 51 | + reactStarlightTypeDoc({ |
| 52 | + entryPoints: ["../react/src/index.ts"], |
| 53 | + output: "reference/react", |
| 54 | + tsconfig: "../react/tsconfig.json", |
| 55 | + sidebar: { |
| 56 | + label: "react", |
| 57 | + collapsed: true, |
| 58 | + }, |
| 59 | + }), |
| 60 | + vueStarlightTypeDoc({ |
| 61 | + entryPoints: ["../vue/src/index.ts"], |
| 62 | + output: "reference/vue", |
| 63 | + tsconfig: "../vue/tsconfig.json", |
| 64 | + sidebar: { |
| 65 | + label: "vue", |
| 66 | + collapsed: true, |
| 67 | + }, |
| 68 | + }), |
| 69 | + reactFullStarlightTypeDoc({ |
| 70 | + entryPoints: ["../react-full/src/index.ts"], |
| 71 | + output: "reference/react-full", |
| 72 | + tsconfig: "../react-full/tsconfig.json", |
| 73 | + sidebar: { |
| 74 | + label: "react-full", |
| 75 | + collapsed: true, |
| 76 | + }, |
| 77 | + }), |
| 78 | + lyricStarlightTypeDoc({ |
| 79 | + entryPoints: ["../lyric/src/types.d.ts"], |
| 80 | + output: "reference/lyric", |
| 81 | + tsconfig: "../lyric/tsconfig.json", |
| 82 | + sidebar: { |
| 83 | + label: "lyric", |
| 84 | + collapsed: true, |
| 85 | + }, |
| 86 | + }), |
| 87 | + ], |
| 88 | + sidebar: [ |
| 89 | + { |
| 90 | + label: "核心组件", |
| 91 | + items: [{ slug: "guides/core/introduction" }], |
| 92 | + }, |
| 93 | + { |
| 94 | + label: "React 绑定", |
| 95 | + items: [ |
| 96 | + { slug: "guides/react/introduction" }, |
| 97 | + { slug: "guides/react/quick-start" }, |
| 98 | + { slug: "guides/react/lyric-player" }, |
| 99 | + { slug: "guides/react/bg-render" }, |
| 100 | + ], |
| 101 | + }, |
| 102 | + { |
| 103 | + label: "AMLL TTML Tools", |
| 104 | + items: [ |
| 105 | + { slug: "guides/ttml-tools/introduction" }, |
| 106 | + { slug: "guides/ttml-tools/tips" }, |
| 107 | + ], |
| 108 | + }, |
| 109 | + { |
| 110 | + label: "接口参考", |
| 111 | + items: [ |
| 112 | + coreTypeDocSidebarGroup, |
| 113 | + reactTypeDocSidebarGroup, |
| 114 | + vueTypeDocSidebarGroup, |
| 115 | + reactFullTypeDocSidebarGroup, |
| 116 | + lyricTypeDocSidebarGroup, |
| 117 | + ], |
| 118 | + }, |
| 119 | + ], |
| 120 | + }), |
| 121 | + ], |
| 122 | +}); |
0 commit comments