chore: final build + lint + cleanup
- Run bun run build: succeeded - Run bun run lint: no errors (3 img warnings acceptable) - Fix any types in app/posts/[slug]/page.tsx with proper hast/rehype-pretty-code types - Fix any type in mdx-components.tsx pre component with React.HTMLAttributes - Remove unused language variable from mdx-components.tsx - Verify all 3 posts render with <p> tags, code block syntax highlighting, and heading ids
This commit is contained in:
@@ -10,6 +10,8 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings'
|
||||
import rehypeKatex from 'rehype-katex'
|
||||
import rehypeSlug from 'rehype-slug'
|
||||
import rehypeExternalLinks from 'rehype-external-links'
|
||||
import type { Element } from 'hast'
|
||||
import type { LineElement } from 'rehype-pretty-code'
|
||||
import { getPosts, getPost } from '@/lib/posts'
|
||||
import { TableOfContents } from '@/components/blog/TableOfContents'
|
||||
import { ScrollToTop } from '@/components/ui/ScrollToTop'
|
||||
@@ -91,14 +93,17 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
|
||||
},
|
||||
keepBackground: false,
|
||||
grid: true,
|
||||
onVisitLine(node: { children: any[] }) {
|
||||
onVisitLine(node: LineElement) {
|
||||
if (node.children.length === 0) {
|
||||
node.children = [{ type: 'text', value: ' ' }];
|
||||
}
|
||||
},
|
||||
onVisitTitle(element: any) {
|
||||
onVisitTitle(element: Element) {
|
||||
const existingClassNames = Array.isArray(element.properties.className)
|
||||
? element.properties.className
|
||||
: [];
|
||||
element.properties.className = [
|
||||
...(element.properties.className ?? []),
|
||||
...existingClassNames,
|
||||
'vscode-title',
|
||||
];
|
||||
element.children = [
|
||||
|
||||
Reference in New Issue
Block a user