import { faLink } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { nodeTypes } from "@mdx-js/mdx" import rehypeShikiFromHighlighter from "@shikijs/rehype/core" import { MDXRemote } from "next-mdx-remote/rsc" import { cookies } from "next/headers" import Image from "next/image" import Link from "next/link" import rehypeKatex from "rehype-katex" import rehypeRaw from "rehype-raw" import rehypeSlug from "rehype-slug" import remarkGfm from "remark-gfm" import remarkMath from "remark-math" import { getHighlighterCore } from "shiki/core" import "katex/dist/katex.min.css" import { BlogPostComments } from "@/blog/BlogPostComments" import { getTheme } from "@/theme/theme.server" const Heading = ( props: React.DetailedHTMLProps< React.HTMLAttributes, HTMLHeadingElement >, ): JSX.Element => { const { children, id = "" } = props return (

{children}

) } export interface BlogPostContentProps { content: string } export const BlogPostContent = async ( props: BlogPostContentProps, ): Promise => { const { content } = props const cookiesStore = cookies() const theme = getTheme() const highlighter = await getHighlighterCore({ themes: [ import("shiki/themes/light-plus.mjs"), import("shiki/themes/dark-plus.mjs"), ], langs: [ import("shiki/langs/markdown.mjs"), import("shiki/langs/shell.mjs"), import("shiki/langs/javascript.mjs"), import("shiki/langs/typescript.mjs"), import("shiki/langs/python.mjs"), ], loadWasm: import("shiki/wasm"), }) return (
{ const { src = "", alt = "Blog Image" } = properties const source = src.replace("../../public/", "/") return ( {alt} ) }, a: (props) => { const { href = "", ...rest } = props if (href.startsWith("#")) { return } if (href.startsWith("../posts/")) { return ( ) } return }, }} />
) }