You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vitepress/v1/assets/zh_guide_migration-from-vue...

3 lines
2.8 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{_ as a,c as s,ag as t,o as r}from"./chunks/framework.C1C4sYC0.js";const u=JSON.parse('{"title":"从 VuePress 迁移","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/migration-from-vuepress.md","filePath":"zh/guide/migration-from-vuepress.md","lastUpdated":1704148534000}'),o={name:"zh/guide/migration-from-vuepress.md"};function i(n,e,d,l,c,h){return r(),s("div",null,e[0]||(e[0]=[t(`<h1 id="migration-from-vuepress" tabindex="-1">从 VuePress 迁移 <a class="header-anchor" href="#migration-from-vuepress" aria-label="Permalink to &quot;从 VuePress 迁移 {#migration-from-vuepress}&quot;"></a></h1><h2 id="config" tabindex="-1">配置 <a class="header-anchor" href="#config" aria-label="Permalink to &quot;配置 {#config}&quot;"></a></h2><h3 id="sidebar" tabindex="-1">侧边栏 <a class="header-anchor" href="#sidebar" aria-label="Permalink to &quot;侧边栏 {#sidebar}&quot;"></a></h3><p>侧边栏不再从 frontmatter 中自动获取。你可以自行阅读 <a href="https://github.com/vuejs/vitepress/issues/572#issuecomment-1170116225" target="_blank" rel="noreferrer"><code>frontmatter</code></a> 来动态填充侧边栏。<a href="https://github.com/vuejs/vitepress/issues/96" target="_blank" rel="noreferrer">迁移工具</a>将来可能会提供。</p><h2 id="markdown" tabindex="-1">Markdown <a class="header-anchor" href="#markdown" aria-label="Permalink to &quot;Markdown {#markdown}&quot;"></a></h2><h3 id="images" tabindex="-1">图片 <a class="header-anchor" href="#images" aria-label="Permalink to &quot;图片 {#images}&quot;"></a></h3><p>与 VuePress 不同在使用静态图片时VitePress 会根据配置自动处理这些 <a href="./asset-handling#base-url"><code>base</code></a>。</p><p>因此,现在可以在没有 <code>img</code> 标签的情况下渲染图像。</p><div class="language-diff vp-adaptive-theme"><button title="复制代码" class="copy"></button><span class="lang">diff</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#B31D28;--shiki-dark:#FDAEB7;">- &lt;img :src=&quot;$withBase(&#39;/foo.png&#39;)&quot; alt=&quot;foo&quot;&gt;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">+ ![foo](/foo.png)</span></span></code></pre></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>对于动态图像,仍然需要 <code>withBase</code>,如 <a href="./asset-handling#base-url">Base URL</a> 中所示。</p></div><p>使用 <code>&lt;img.*withBase\\(&#39;(.*)&#39;\\).*alt=&quot;([^&quot;]*)&quot;.*&gt;</code> 正则表达式查找并替换为 <code>![$2]($1)</code> 用 <code>![](...)</code> 语法替换所有图像。</p><hr><p>更多请继续关注...</p>`,13)]))}const m=a(o,[["render",i]]);export{u as __pageData,m as default};