fix: compute reading time from post content not title
This commit is contained in:
@@ -6,7 +6,7 @@ import remarkGfm from 'remark-gfm'
|
|||||||
import rehypePrettyCode from 'rehype-pretty-code'
|
import rehypePrettyCode from 'rehype-pretty-code'
|
||||||
import rehypeKatex from 'rehype-katex'
|
import rehypeKatex from 'rehype-katex'
|
||||||
import rehypeSlug from 'rehype-slug'
|
import rehypeSlug from 'rehype-slug'
|
||||||
import { getPosts, getPost, getReadingTime } from '@/lib/posts'
|
import { getPosts, getPost } from '@/lib/posts'
|
||||||
import { TableOfContents } from '@/components/blog/TableOfContents'
|
import { TableOfContents } from '@/components/blog/TableOfContents'
|
||||||
import { ScrollToTop } from '@/components/ui/ScrollToTop'
|
import { ScrollToTop } from '@/components/ui/ScrollToTop'
|
||||||
import { ReadingProgress } from '@/components/ui/ReadingProgress'
|
import { ReadingProgress } from '@/components/ui/ReadingProgress'
|
||||||
@@ -45,7 +45,7 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
|
|||||||
{post.title}
|
{post.title}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="font-mono text-xs text-ink-soft">
|
<p className="font-mono text-xs text-ink-soft">
|
||||||
{getReadingTime(post.title)} min read
|
{post.readingTime} min read
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<div className="prose prose-lg max-w-none">
|
<div className="prose prose-lg max-w-none">
|
||||||
|
|||||||
Reference in New Issue
Block a user