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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
const TR_MAP: Record<string, string> = {
|
||||
ç: 'c',
|
||||
ğ: 'g',
|
||||
ı: 'i',
|
||||
İ: 'i',
|
||||
ö: 'o',
|
||||
ş: 's',
|
||||
ü: 'u',
|
||||
Ç: 'c',
|
||||
Ğ: 'g',
|
||||
Ö: 'o',
|
||||
Ş: 's',
|
||||
Ü: 'u',
|
||||
};
|
||||
|
||||
/** Turkish-aware slugify: "Çift Bant Anten" → "cift-bant-anten". */
|
||||
export function slugify(input: string): string {
|
||||
return input
|
||||
.replace(/[çğıİöşüÇĞÖŞÜ]/g, (ch) => TR_MAP[ch] ?? ch)
|
||||
.normalize('NFKD')
|
||||
.replace(/[̀-ͯ]/g, '')
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-+|-+$/g, '');
|
||||
}
|
||||
Reference in New Issue
Block a user