feat: implement programmatic SEO infrastructure with localized service pages

This commit is contained in:
AyrisAI
2026-05-16 00:55:42 +03:00
parent c5703c060d
commit d0a7205f90
5 changed files with 300 additions and 3 deletions

50
setup_locations.mjs Normal file
View File

@@ -0,0 +1,50 @@
import postgres from 'postgres';
import dotenv from 'dotenv';
dotenv.config({ path: '.env.local' });
const sql = postgres(process.env.DATABASE_URL);
async function setup() {
try {
console.log('Creating locations table...');
await sql`
CREATE TABLE IF NOT EXISTS locations (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
slug VARCHAR(255) UNIQUE NOT NULL,
description TEXT,
display_order INTEGER DEFAULT 0
)
`;
const locations = [
{ name: 'Bodrum', slug: 'bodrum', description: 'Bodrum profesyonel drone çekimi ve dijital medya çözümleri.' },
{ name: 'Marmaris', slug: 'marmaris', description: 'Marmaris otel çekimleri ve sosyal medya yönetimi.' },
{ name: 'Fethiye', slug: 'fethiye', description: 'Fethiye turizm odaklı video prodüksiyon hizmetleri.' },
{ name: 'Datça', slug: 'datca', description: 'Datça butik işletmeler için dijital pazarlama.' },
{ name: 'Dalaman', slug: 'dalaman', description: 'Dalaman kurumsal tanıtım ve drone hizmetleri.' },
{ name: 'Milas', slug: 'milas', description: 'Milas sanayi ve tarım odaklı prodüksiyon çözümleri.' },
{ name: 'Menteşe', slug: 'mentese', description: 'Muğla merkez Menteşe kurumsal medya yönetimi.' }
];
console.log('Inserting locations...');
for (const loc of locations) {
await sql`
INSERT INTO locations (name, slug, description)
VALUES (${loc.name}, ${loc.slug}, ${loc.description})
ON CONFLICT (slug) DO UPDATE SET
name = EXCLUDED.name,
description = EXCLUDED.description
`;
}
console.log('Locations setup complete!');
process.exit(0);
} catch (err) {
console.error('Error setting up locations:', err);
process.exit(1);
}
}
setup();