Skip to content

Commit 6204234

Browse files
Added the local readTime function to calculate the reading time
1 parent fc4dc68 commit 6204234

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/blog/_blog-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import marked from 'marked';
77
import Prism from 'prismjs';
88
import 'prism-svelte';
99
import loadLanguages from 'prismjs/components/index.js';
10-
import readingTime from 'reading-time';
10+
import { readingTime } from '$lib/utils/reading-time';
1111

1212
loadLanguages(['shell', 'markdown', 'json']);
1313

@@ -54,7 +54,7 @@ const posts = fs
5454
};
5555
const html = marked(postFrontMatter.body, { renderer });
5656

57-
const readingTimeDuration = readingTime(postFrontMatter.body).text;
57+
const readingTimeDuration = readingTime(postFrontMatter.body).time;
5858

5959
return {
6060
metadata: {

0 commit comments

Comments
 (0)