Files
suphicakir c5e0b009ca feat: scaffold Astro 7 with Tailwind 4, MDX, sitemap, node adapter and tooling
- Tailwind v4 via @tailwindcss/vite + typography plugin
- astro-icon (Tabler), self-hosted Rubik/Inter, RSS, Pagefind postbuild
- Prettier (astro + tailwind plugins), editorconfig
- new:post script with Turkish-aware slugify

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:25:29 +03:00

50 lines
1.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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)`);