// Usage: npm run new:post -- "Yazı Başlığı" import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { slugify } from '../src/lib/slug.ts'; const title = process.argv.slice(2).join(' ').trim(); if (!title) { console.error('Kullanım: npm run new:post -- "Yazı Başlığı"'); process.exit(1); } const slug = slugify(title); const dir = join('src', 'content', 'blog', slug); if (existsSync(dir)) { console.error(`Zaten var: ${dir}`); process.exit(1); } const today = new Intl.DateTimeFormat('en-CA', { timeZone: 'Europe/Istanbul' }).format(new Date()); const body = `--- title: ${JSON.stringify(title)} description: "Arama sonuçlarında görünecek 120–155 karakterlik açıklama." pubDate: ${today} # updatedDate: ${today} category: "genel" tags: [] # cover: "./kapak.jpg" # coverAlt: "Kapak görselinin anlamlı açıklaması" featured: false diy: false draft: true --- Giriş paragrafı: yazının neyi anlattığını ve okuyucunun ne kazanacağını 2–3 cümlede söyle. ## Birinci Bölüm Metin… ## Sonuç Kısa özet ve varsa sonraki adımlar. 73 de TA1SPH `; mkdirSync(dir, { recursive: true }); writeFileSync(join(dir, 'index.md'), body); console.log(`Oluşturuldu: ${join(dir, 'index.md')} (draft: true)`);