Overview
Theastro.config.ts file is the main configuration file for your Astro project. It defines build settings, integrations, and site-wide options that control how your portfolio is built and deployed.
Configuration File
Here’s the complete configuration used in this template:astro.config.ts
Configuration Options
site
site option defines the base URL where your portfolio will be deployed. This is used for:
- Generating absolute URLs in sitemaps
- Creating canonical URLs for SEO
- Building RSS feeds
- Social media meta tags
integrations
Astro integrations add framework support and additional functionality to your project. This template uses three core integrations:React Integration
- Use React components within Astro pages
- Leverage the React ecosystem and libraries
- Create interactive UI components with React’s state management
- Use React hooks and context
Tailwind CSS Integration
applyBaseStyles: false: Disables Tailwind’s default base styles (Preflight). This gives you more control over base HTML element styling and prevents conflicts with custom global styles.
- Allows custom typography and spacing rules
- Prevents unwanted style resets
- Gives more control over default element appearance
- Works better with component libraries that provide their own base styles
MDX Integration
- Writing Markdown with embedded React components
- Creating dynamic, interactive documentation
- Importing and using components directly in content files
- Combining the simplicity of Markdown with the power of React
Additional Configuration Options
While not used in this template, here are other useful Astro configuration options you might want to add:Output Mode
static(default): All pages pre-rendered at build timeserver: Pages rendered on-demandhybrid: Mix of static and server-rendered pages
Base Path
Build Options
Server Options
Customization Guide
Updating Your Site URL
- Open
astro.config.ts - Update the
sitevalue to your domain:
Adding New Integrations
-
Install the integration:
-
Import and add to config: