import { defineConfig } from 'astro/config'; import tailwindcss from '@tailwindcss/vite'; import sitemap from '@astrojs/sitemap'; import starlight from '@astrojs/starlight'; import mdx from '@astrojs/mdx'; const redirectOnlyPaths = new Set([ '/product/', '/products/', '/services/', '/blog/', '/insights/', '/en/product/', '/en/products/', '/en/services/', '/en/blog/', '/en/insights/', ]); const isRedirectOnlySitemapPath = page => { const pathname = page.startsWith('http') ? new URL(page).pathname : page; const normalized = pathname.endsWith('/') ? pathname : `${pathname}/`; return redirectOnlyPaths.has(normalized); }; // https://astro.build/config export default defineConfig({ devToolbar: { enabled: false, }, // https://docs.astro.build/en/guides/images/#authorizing-remote-images site: process.env.PUBLIC_SITE_URL ?? 'https://tenantial.com', image: { domains: ['images.unsplash.com'], }, prefetch: true, integrations: [ sitemap({ filter: page => !isRedirectOnlySitemapPath(page), i18n: { defaultLocale: 'de', locales: { de: 'de', en: 'en', }, }, }), starlight({ title: 'Tenantial Docs', // https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md // If no Astro and Starlight i18n configurations are provided, the built-in default locale is used in Starlight and a matching Astro i18n configuration is generated/used. // If only a Starlight i18n configuration is provided, an equivalent Astro i18n configuration is generated/used. // If only an Astro i18n configuration is provided, the Starlight i18n configuration is updated to match it. // If both an Astro and Starlight i18n configurations are provided, an error is thrown. locales: { root: { label: 'Deutsch', lang: 'de', }, en: { label: 'English', lang: 'en', }, }, // https://starlight.astro.build/guides/sidebar/ sidebar: [ { label: 'Evaluierungsleitfaeden', translations: { en: 'Evaluation Guides', }, items: [{ autogenerate: { directory: 'guides' } }], }, { label: 'Plattform-Notizen', translations: { en: 'Platform Notes', }, items: [ { label: 'Evidence Review', link: 'platform/evidence-review/' }, ], }, ], social: [], disable404Route: true, customCss: ['./src/assets/styles/starlight.css'], favicon: '/favicon.ico', components: { SiteTitle: './src/components/ui/starlight/SiteTitle.astro', Head: './src/components/ui/starlight/Head.astro', MobileMenuFooter: './src/components/ui/starlight/MobileMenuFooter.astro', ThemeSelect: './src/components/ui/starlight/ThemeSelect.astro', }, }), mdx(), ], experimental: { clientPrerender: true, }, vite: { plugins: [tailwindcss()], }, });