Skip to content

Commit 8979b14

Browse files
authored
docs: add markdown-it-image-size to reduce layout shift (#20474)
1 parent 546588a commit 8979b14

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

docs/.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from 'vitepress-plugin-group-icons'
1010
import llmstxt from 'vitepress-plugin-llms'
1111
import type { PluginOption } from 'vite'
12+
import { markdownItImageSize } from 'markdown-it-image-size'
1213
import { buildEnd } from './buildEnd.config'
1314

1415
const ogDescription = 'Next Generation Frontend Tooling'
@@ -482,6 +483,9 @@ export default defineConfig({
482483
codeTransformers: [transformerTwoslash()],
483484
config(md) {
484485
md.use(groupIconMdPlugin)
486+
md.use(markdownItImageSize, {
487+
publicDir: path.resolve(import.meta.dirname, '../public'),
488+
})
485489
},
486490
},
487491
vite: {

docs/guide/api-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ When creating a plugin, you can inline it in your `vite.config.js`. There is no
1212

1313
::: tip
1414
When learning, debugging, or authoring plugins, we suggest including [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) in your project. It allows you to inspect the intermediate state of Vite plugins. After installing, you can visit `localhost:5173/__inspect/` to inspect the modules and transformation stack of your project. Check out install instructions in the [vite-plugin-inspect docs](https://github.com/antfu/vite-plugin-inspect).
15-
![vite-plugin-inspect](/images/vite-plugin-inspect.png)
15+
![vite-plugin-inspect](../images/vite-plugin-inspect.png)
1616
:::
1717

1818
## Conventions

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@types/express": "^5.0.3",
1313
"feed": "^5.1.0",
1414
"gsap": "^3.13.0",
15+
"markdown-it-image-size": "^14.7.0",
1516
"vitepress": "^2.0.0-alpha.8",
1617
"vitepress-plugin-group-icons": "^1.6.1",
1718
"vitepress-plugin-llms": "^1.7.1",

pnpm-lock.yaml

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)