1
1
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:
Divlo
2022-08-27 02:30:55 +02:00
parent 83231197dd
commit c1877297f8
12 changed files with 4189 additions and 7999 deletions

View File

@ -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} />