chore: scaffold Astro 5 project with token/style layer
- Astro 5 static config (trailing-slash canonical, i18n en-root/no-prefixed) - Tailwind 4 over CSS custom-property tokens (both themes via [data-theme]) - design tokens: colour/spacing/type/radius/motion per Phase 1 specs - motion layer with reduced-motion overrides - strict TypeScript, ESLint flat config, Prettier - self-hosted variable fonts (Space Grotesk / Inter / JetBrains Mono) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from 'astro/config';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// Canonical origin used for absolute URLs (sitemap, OG, hreflang, JSON-LD).
|
||||
// Overridable at build time so staging emits its own origin. See DOCKER_SPEC §3.
|
||||
const SITE = process.env.PUBLIC_SITE_URL ?? 'https://cesnimda.co.uk';
|
||||
|
||||
const r = (p) => fileURLToPath(new URL(p, import.meta.url));
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: SITE,
|
||||
// ROUTING_SPEC §1: trailing-slash canonical, directory output.
|
||||
trailingSlash: 'always',
|
||||
build: { format: 'directory', inlineStylesheets: 'auto' },
|
||||
// I18N_SPEC §1: en at root, no prefixed. Localised slugs are handled by explicit
|
||||
// page files + the slug map module (ARCHITECTURE A5), not automatic locale routing.
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'no'],
|
||||
routing: { prefixDefaultLocale: false, redirectToDefaultLocale: false },
|
||||
},
|
||||
prefetch: false,
|
||||
compressHTML: true,
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': r('./src'),
|
||||
'@i18n': r('./src/i18n'),
|
||||
'@components': r('./src/components'),
|
||||
'@layouts': r('./src/layouts'),
|
||||
'@styles': r('./src/styles'),
|
||||
'@scripts': r('./src/scripts'),
|
||||
'@lib': r('./src/lib'),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user