|
| 1 | +// @ts-check |
| 2 | +import { defineConfig } from 'astro/config'; |
| 3 | +import starlight from '@astrojs/starlight'; |
| 4 | +import react from '@astrojs/react'; |
| 5 | +import mdx from '@astrojs/mdx'; |
| 6 | +import tailwindcss from '@tailwindcss/vite'; |
| 7 | +import rehypeCodeGroup from 'rehype-code-group'; |
| 8 | +import expressiveCode from 'astro-expressive-code'; |
| 9 | +import { pluginFullscreen } from 'expressive-code-fullscreen'; |
| 10 | +import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections'; |
| 11 | +import rehypeAstroRelativeMarkdownLinks from 'astro-rehype-relative-markdown-links'; |
| 12 | + |
| 13 | +// https://astro.build/config |
| 14 | +export default defineConfig({ |
| 15 | + integrations: [ |
| 16 | + starlight({ |
| 17 | + title: 'React Admin Headless', |
| 18 | + customCss: ['./src/styles/global.css'], |
| 19 | + favicon: '/favicon.ico', |
| 20 | + social: [ |
| 21 | + { |
| 22 | + icon: 'github', |
| 23 | + label: 'GitHub', |
| 24 | + href: 'https://github.com/marmelab/react-admin', |
| 25 | + }, |
| 26 | + ], |
| 27 | + sidebar: [ |
| 28 | + { |
| 29 | + label: 'Guides & Concepts', |
| 30 | + items: [ |
| 31 | + // Each item here is one entry in the navigation menu. |
| 32 | + { |
| 33 | + label: 'General Concepts', |
| 34 | + slug: 'guides/architecture', |
| 35 | + }, |
| 36 | + { |
| 37 | + label: 'Data Fetching', |
| 38 | + slug: 'guides/datafetchingguide', |
| 39 | + }, |
| 40 | + { |
| 41 | + label: 'CRUD pages', |
| 42 | + slug: 'guides/crud', |
| 43 | + attrs: { |
| 44 | + class: 'flex items-center', |
| 45 | + }, |
| 46 | + badge: { |
| 47 | + text: '', |
| 48 | + variant: 'default', |
| 49 | + class: 'ee-badge', |
| 50 | + }, |
| 51 | + }, |
| 52 | + ], |
| 53 | + }, |
| 54 | + { |
| 55 | + label: 'Reference', |
| 56 | + autogenerate: { |
| 57 | + directory: 'reference', |
| 58 | + }, |
| 59 | + }, |
| 60 | + ], |
| 61 | + components: { |
| 62 | + Sidebar: './src/components/CustomSidebar.astro', |
| 63 | + }, |
| 64 | + }), |
| 65 | + expressiveCode({ |
| 66 | + plugins: [pluginFullscreen(), pluginCollapsibleSections()], |
| 67 | + }), |
| 68 | + react(), |
| 69 | + mdx(), |
| 70 | + ], |
| 71 | + markdown: { |
| 72 | + rehypePlugins: [ |
| 73 | + rehypeCodeGroup, |
| 74 | + [ |
| 75 | + rehypeAstroRelativeMarkdownLinks, |
| 76 | + { |
| 77 | + base: '/ra-core/', |
| 78 | + collectionBase: false, |
| 79 | + }, |
| 80 | + ], |
| 81 | + ], |
| 82 | + }, |
| 83 | + vite: { |
| 84 | + plugins: [tailwindcss()], |
| 85 | + }, |
| 86 | + base: '/ra-core/', |
| 87 | + site: 'https://marmelab.com', |
| 88 | + build: { |
| 89 | + assets: 'assets', |
| 90 | + }, |
| 91 | +}); |
0 commit comments