Skip to content

Commit

Permalink
docs: image migration guide for vuepress (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki authored Jun 16, 2022
1 parent fa00c83 commit 0d311ff
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docs/guide/migration-from-vuepress.md
Original file line number Diff line number Diff line change
@@ -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...

0 comments on commit 0d311ff

Please sign in to comment.