mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
refactor: minor changes
This commit is contained in:
@ -37,6 +37,14 @@ const BlogPostPage: NextPage<BlogPostPageProps> = (props) => {
|
||||
<MDXRemote
|
||||
{...post.source}
|
||||
components={{
|
||||
img: (properties) => {
|
||||
const { src, alt, ...props } = properties
|
||||
let source = src
|
||||
if (src?.startsWith('../public/') ?? false) {
|
||||
source = src?.replace('../public/', '/')
|
||||
}
|
||||
return <img src={source} alt={alt} {...props} />
|
||||
},
|
||||
a: (props: React.ComponentPropsWithoutRef<'a'>) => {
|
||||
if (props.href?.startsWith('#') ?? false) {
|
||||
return <a {...props} />
|
||||
|
Reference in New Issue
Block a user