|
| 1 | +// @ts-check |
| 2 | +import { rehypeHeadingIds } from '@astrojs/markdown-remark'; |
| 3 | +import starlight from '@astrojs/starlight'; |
| 4 | +import { defineConfig } from 'astro/config'; |
| 5 | +import { remarkDefinitionList, defListHastHandlers } from 'remark-definition-list'; |
| 6 | +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; |
| 7 | +import rehypeWidont from 'rehype-widont'; |
| 8 | +import starlightLinksValidator from 'starlight-links-validator'; |
| 9 | + |
| 10 | +// https://astro.build/config |
| 11 | +export default defineConfig({ |
| 12 | + integrations: [ |
| 13 | + starlight({ |
| 14 | + title: 'xivapi', |
| 15 | + favicon: '/favicon.ico', |
| 16 | + logo: { |
| 17 | + light: './src/assets/logo-light.png', |
| 18 | + dark: './src/assets/logo-dark.png', |
| 19 | + replacesTitle: true, |
| 20 | + }, |
| 21 | + social: { |
| 22 | + discord: 'https://discord.gg/MFFVHWC', |
| 23 | + github: 'https://github.com/xivapi', |
| 24 | + }, |
| 25 | + sidebar: [ |
| 26 | + 'docs/welcome', |
| 27 | + { |
| 28 | + label: 'Guides', |
| 29 | + autogenerate: { directory: 'docs/guides' }, |
| 30 | + }, |
| 31 | + 'docs/software', |
| 32 | + { |
| 33 | + label: 'API Reference', |
| 34 | + link: '/api/1/docs', |
| 35 | + attrs: { target: '_blank' }, |
| 36 | + } |
| 37 | + ], |
| 38 | + components: { |
| 39 | + Hero: './src/components/Hero.astro', |
| 40 | + MarkdownContent: './src/components/MarkdownContent.astro', |
| 41 | + }, |
| 42 | + customCss: [ |
| 43 | + './src/styles/headings.css', |
| 44 | + './src/styles/icons.css', |
| 45 | + './src/styles/theme.css', |
| 46 | + ], |
| 47 | + plugins: [starlightLinksValidator({ |
| 48 | + exclude: ['/api/1/**'] |
| 49 | + })], |
| 50 | + }), |
| 51 | + ], |
| 52 | + markdown: { |
| 53 | + remarkPlugins: [remarkDefinitionList], |
| 54 | + rehypePlugins: [ |
| 55 | + rehypeHeadingIds, |
| 56 | + [rehypeAutolinkHeadings, { behavior: 'wrap' }], |
| 57 | + rehypeWidont |
| 58 | + ], |
| 59 | + remarkRehype: { |
| 60 | + handlers: { ...defListHastHandlers }, |
| 61 | + }, |
| 62 | + }, |
| 63 | +}); |
0 commit comments