remove tags from article header (#6)

This commit is contained in:
Troy 2024-12-28 16:19:26 +00:00 committed by GitHub
parent 01f721f938
commit 4487fb0945
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 50 additions and 68 deletions

View file

@ -10,7 +10,7 @@ export function readingTime(html: string) {
const textOnly = html.replace(/<[^>]+>/g, "");
const wordCount = textOnly.split(/\s+/).length;
const readingTimeMinutes = (wordCount / 200 + 1).toFixed();
return `${wordCount} words (~${readingTimeMinutes} min read)`;
return `${wordCount} words (${readingTimeMinutes} mins)`;
}
export function dateRange(startDate: Date, endDate?: Date | string): string {