docs: image migration guide for vuepress ()

pull/803/head
JD Solanki 3 years ago committed by GitHub
parent fa00c83af4
commit 0d311ffd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,24 @@
# Migration from VuePress
Coming soon...
## Markdown
### Images
Unlike VuePress, VitePress handles [`base`](/guide/asset-handling.html#base-url) of your config automatically when you use static image.
Hence, now you can render images without `img` tag.
```diff
- <img :src="$withBase('/foo.png')" alt="foo">
+ ![foo](/foo.png)
```
::: warning
For dynamic images you still need `withBase` as shown in [Base URL guide](/guide/asset-handling.html#base-url).
:::
Use `<img.*withBase\('(.*)'\).*alt="([^"]*)".*>` regex to find and replace it with `![$2]($1)` to replace all the images with `![](...)` syntax.
---
more to follow...

Loading…
Cancel
Save