From 0d311ffd96679d25f2b0e6341f40d35a3f642fd7 Mon Sep 17 00:00:00 2001 From: JD Solanki <47495003+jd-solanki@users.noreply.github.com> Date: Thu, 16 Jun 2022 20:29:30 +0530 Subject: [PATCH] docs: image migration guide for vuepress (#799) --- docs/guide/migration-from-vuepress.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/guide/migration-from-vuepress.md b/docs/guide/migration-from-vuepress.md index 75faf43a..c18c754f 100644 --- a/docs/guide/migration-from-vuepress.md +++ b/docs/guide/migration-from-vuepress.md @@ -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"> ++  +``` + +::: 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 `` to replace all the images with `` syntax. + +--- + +more to follow...