Update migration-from-vuepress.md

pull/4060/head
Polaris 1 year ago committed by GitHub
parent a73fe0b13e
commit e8df271ff1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,9 +10,9 @@ The sidebar is no longer automatically populated from frontmatter. You can [read
### Images
Unlike VuePress, VitePress handles [`base`](./asset-handling#base-url) of your config automatically when you use static image.
Unlike VuePress, VitePress handles [`base`](./asset-handling#base-url) of your config automatically when you use a static image.
Hence, now you can render images without `img` tag.
As a result, you can render images without needing an `img` tag.
```diff
- <img :src="$withBase('/foo.png')" alt="foo">
@ -20,7 +20,7 @@ Hence, now you can render images without `img` tag.
```
::: warning
For dynamic images you still need `withBase` as shown in [Base URL guide](./asset-handling#base-url).
For dynamic images, you still need `withBase` as shown in [Base URL guide](./asset-handling#base-url).
:::
Use `<img.*withBase\('(.*)'\).*alt="([^"]*)".*>` regex to find and replace it with `![$2]($1)` to replace all the images with `![](...)` syntax.

Loading…
Cancel
Save