initial commit

This commit is contained in:
2026-07-14 22:02:24 +03:00
parent a80849829a
commit 6453730766
2783 changed files with 6055 additions and 238 deletions
+11
View File
@@ -0,0 +1,11 @@
export function excerpt(body: string, length = 160): string {
const plain = body
.replace(/```[\s\S]*?```/g, ' ')
.replace(/!\[.*?\]\([^)]*\)/g, ' ')
.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
.replace(/[#>*_`~]/g, ' ')
.replace(/\s+/g, ' ')
.trim();
return plain.length > length ? `${plain.slice(0, length).trimEnd()}` : plain;
}
+12
View File
@@ -0,0 +1,12 @@
export function slugify(text: string): string {
return text
.toLocaleLowerCase('tr-TR')
.replace(/ğ/g, 'g')
.replace(/ü/g, 'u')
.replace(/ş/g, 's')
.replace(/ı/g, 'i')
.replace(/ö/g, 'o')
.replace(/ç/g, 'c')
.replace(/[^a-z0-9]+/g, '-')
.replace(/(^-|-$)/g, '');
}