feat: implement programmatic SEO routes and optimize meta tags
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export function slugify(text: string) {
|
||||
if (!text) return "";
|
||||
const trMap: { [key: string]: string } = {
|
||||
'ç': 'c', 'ğ': 'g', 'ı': 'i', 'ö': 'o', 'ş': 's', 'ü': 'u',
|
||||
'Ç': 'C', 'Ğ': 'G', 'İ': 'I', 'Ö': 'O', 'Ş': 'S', 'Ü': 'U'
|
||||
};
|
||||
const normalized = text.replace(/[çğıöşüÇĞİÖŞÜ]/g, (match) => trMap[match]);
|
||||
return normalized
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9 -]/g, '')
|
||||
.replace(/\s+/g, '-')
|
||||
.replace(/-+/g, '-');
|
||||
}
|
||||
Reference in New Issue
Block a user