added robots.txt and sitemap

This commit is contained in:
2025-07-01 13:54:12 -07:00
parent f477117a88
commit 7a08b6543c
4 changed files with 220 additions and 2 deletions

View File

@@ -1,18 +1,59 @@
import { defineConfig } from 'astro/config';
import dotenv from 'dotenv';
import node from '@astrojs/node'; // Add this import
import node from '@astrojs/node';
import sitemap from '@astrojs/sitemap';
// Environment detection
const isProd = process.env.NODE_ENV === 'production';
dotenv.config();
export default defineConfig({
site: 'https://juchatz.com', // Required for sitemap generation
output: 'server',
adapter: node({
mode: 'standalone'
}),
// Integrations
integrations: [
sitemap({
changefreq: 'monthly',
priority: 0.8,
serialize(item) {
// Homepage gets highest priority
if (item.url === 'https://juchatz.com/' || item.url === 'https://juchatz.com') {
item.priority = 1.0;
item.changefreq = 'monthly';
}
// Main services page
else if (item.url === 'https://juchatz.com/services/' || item.url === 'https://juchatz.com/services') {
item.priority = 0.9;
item.changefreq = 'monthly';
}
// Individual service pages
else if (item.url.includes('/services/')) {
item.priority = 0.8;
item.changefreq = 'monthly';
}
// About page
else if (item.url.includes('/about')) {
item.priority = 0.8;
item.changefreq = 'quarterly';
}
// Contact page gets lower priority
else if (item.url.includes('/contact')) {
item.priority = 0.7;
item.changefreq = 'quarterly';
}
return item;
},
// Filter out API routes and other non-page URLs
filter: (page) => !page.includes('/api/')
})
],
// Development server settings
server: {
host: '0.0.0.0',