diff --git a/docs/.vitepress/ext/vite/vite.ts b/docs/.vitepress/ext/vite/vite.ts index 6a58267a2..1c3f938ce 100644 --- a/docs/.vitepress/ext/vite/vite.ts +++ b/docs/.vitepress/ext/vite/vite.ts @@ -7,7 +7,8 @@ export const Vite: UserConfig = { ext: ".md", enforce: "pre", local: "./docs/public/assets", - cache: "./docs/public/assets/remote/.cache" + cache: "./docs/public/assets/remote/.cache", + width: 720 })], resolve: { alias: [override("NotFound", "not-found")] } }; diff --git a/docs/.vitepress/imgit/server/transform/5-build.ts b/docs/.vitepress/imgit/server/transform/5-build.ts index 6b16c5cc4..46c4df372 100644 --- a/docs/.vitepress/imgit/server/transform/5-build.ts +++ b/docs/.vitepress/imgit/server/transform/5-build.ts @@ -48,5 +48,8 @@ export function buildServeRoot(asset: EncodedAsset): string { } function buildStyle(size: AssetSize) { - return `style="width: ${size.width}px; height: ${size.height}px"`; + const mod = config.width && size.width > config.width ? config.width / size.width : 1; + const width = Math.floor(size.width * mod); + const height = Math.floor(size.height * mod); + return `style="width: ${width}px; height: ${height}px"`; }