diff --git a/src/components/Layout/HomeContent.js b/src/components/Layout/HomeContent.js index f9b785db420..ce4893eb3e3 100644 --- a/src/components/Layout/HomeContent.js +++ b/src/components/Layout/HomeContent.js @@ -34,6 +34,7 @@ import CodeBlock from 'components/MDX/CodeBlock'; import {ExternalLink} from 'components/ExternalLink'; import sidebarBlog from '../../sidebarBlog.json'; import * as React from 'react'; +import uwuLogo from '../../../public/images/uwu.png'; import Image from 'next/image'; function Section({children, background = null}) { @@ -509,11 +510,11 @@ export function HomeContent() {
- logo by @sawaratsuki1004
@@ -789,24 +790,26 @@ const CommunityImages = memo(function CommunityImages({isLazy}) {
- {alt}
@@ -1564,7 +1567,7 @@ function Cover({background, children}) {
{children}
-
{image.speakers.map((src, i) => ( - ))} diff --git a/src/components/MDX/MDXComponents.tsx b/src/components/MDX/MDXComponents.tsx index 334e72f3482..c5d31bdf4d0 100644 --- a/src/components/MDX/MDXComponents.tsx +++ b/src/components/MDX/MDXComponents.tsx @@ -13,6 +13,7 @@ import {Children, useContext, useMemo} from 'react'; import * as React from 'react'; import cn from 'classnames'; import type {HTMLAttributes} from 'react'; +import NextImage from 'next/image'; import CodeBlock from './CodeBlock'; import {CodeDiagram} from './CodeDiagram'; @@ -297,6 +298,21 @@ const IllustrationContext = React.createContext<{ isInBlock: false, }); +function toNumber(value: unknown, fallback: number) { + if (typeof value === 'number' && Number.isFinite(value)) { + return value; + } + + if (typeof value === 'string') { + const parsed = Number(value); + if (Number.isFinite(parsed) && parsed > 0) { + return parsed; + } + } + + return fallback; +} + function Illustration({ caption, src, @@ -315,10 +331,12 @@ function Illustration({ return (
- {alt} {caption ? ( @@ -351,11 +369,13 @@ function IllustrationBlock({ const images = imageInfos.map((info, index) => (
- {info.alt}
{info.caption ? ( @@ -485,9 +505,19 @@ function YouTubeIframe(props: any) { ); } -function Image(props: any) { - const {alt, ...rest} = props; - return {alt}; +function MdxImage(props: any) { + const {alt = '', width, height, className, style, ...rest} = props; + + return ( + + ); } export const MDXComponents = { @@ -504,7 +534,7 @@ export const MDXComponents = { h5: H5, hr: Divider, a: Link, - img: Image, + img: MdxImage, BlogCard, code: InlineCode, pre: CodeBlock,