From eab546a7b6ee7f995828ba3264d07a9b12fa9c1e Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 6 Apr 2022 11:42:49 +0800 Subject: [PATCH] Add: image processing --- components/PostLayout.js | 1 - pages/posts/images.mdx | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 pages/posts/images.mdx diff --git a/components/PostLayout.js b/components/PostLayout.js index 31e41e8..ae8994d 100644 --- a/components/PostLayout.js +++ b/components/PostLayout.js @@ -9,7 +9,6 @@ const components = { h4: (props) => , h5: (props) => , h6: (props) => , - img: (props) => {props.alt}, code: (props) => ( + +此处使用了 Next.js 的 `Image` 组件。优点包括: + +- 在构建时图片预先被转换成多种分辨率,根据用户设备大小返回相应的分辨率图片。 + +- 提升加载速度。 + +- 在未加载完整图片是显示一个模糊的预览图。 + +- 防止 *加载时布局移动* + +export default ({children}) => {children}