mirror of https://github.com/YunYouJun/valaxy
docs: update migration
This commit is contained in:
parent
2df2c88c79
commit
e64fb6c2fd
|
@ -78,7 +78,9 @@ Push to your GitHub repository, and go to `Settings` -> `Pages`. Select `gh-page
|
|||
#### Netlify
|
||||
|
||||
::: zh-CN
|
||||
已内置 `netlify.toml`.
|
||||
已内置 `netlify.toml`。
|
||||
|
||||
连接 GitHub 仓库,可以自动部署。
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
@ -88,21 +90,21 @@ Push to your GitHub repository, and go to `Settings` -> `Pages`. Select `gh-page
|
|||
#### Vercel
|
||||
|
||||
::: zh-CN
|
||||
在 Vercel 的 Dashboard 上,点击 “Add New...”,然后点击 “Project” 新建一个项目。
|
||||
在 Vercel 的 Dashboard 上,点击 `Add New...`,随后点击 `Project` 新建一个项目。
|
||||
|
||||
在左侧选择要部署的仓库,点击 “Import”,随后将 “Framework Preset” 设置为 “Other” 并更改 “Build and Output Settings”。
|
||||
在左侧选择要部署的仓库,点击 `Import`,随后将 `Framework Preset` 设置为 `Other` 并更改 `Build and Output Settings`。
|
||||
|
||||
将 “Output Directory” 设置为 `dist` 后,点击 “Deploy”。
|
||||
将 `Output Directory` 设置为 `dist` 后,点击 `Deploy`。
|
||||
|
||||
等待屏幕上撒下彩带后访问即可。
|
||||
:::
|
||||
|
||||
::: en
|
||||
On Vercel Dashboard, click "Add New...", then click "Project" to create a project.
|
||||
On Vercel Dashboard, click `Add New...`, then click `Project` to create a project.
|
||||
|
||||
Select the repository you want to deploy and click "Import" and then set "Framework Preset" to "Other" and modify "Build and Output Settings".
|
||||
Select the repository you want to deploy and click `Import` and then set `Framework Preset` to `Other` and modify `Build and Output Settings`.
|
||||
|
||||
Turn on the switch on the right of the textbox and type `dist`, click "Deploy".
|
||||
Turn on the switch on the right of the textbox and type `dist`, click `Deploy`.
|
||||
|
||||
Wait for ribbons to drop on the screen, then visit your website.
|
||||
:::
|
||||
|
@ -112,21 +114,25 @@ Wait for ribbons to drop on the screen, then visit your website.
|
|||
::: zh-CN
|
||||
登录你的 Cloudflare 账号,导航到 “Pages” 页面。
|
||||
|
||||
点击 “创建项目”、“连接到 Git”,然后选择你的 GitHub 或者 GitLab 仓库并点击 “开始设置”。
|
||||
点击 `创建项目`、`连接到 Git`,选择你的 GitHub 或者 GitLab 仓库,并点击 `开始设置`。
|
||||
|
||||
选择你要部署的分支,将 “构建输出目录” 设置为 `dist` 后添加一个环境变量。
|
||||
选择你的部署分支,将 `构建输出目录` 设置为 `dist` 后添加一个环境变量。
|
||||
|
||||
“变量名称” 设置为 `NODE_VERSION`,值为 `16.0`,然后点击 “保存并部署”。
|
||||
> `NODE_VERSION`: `16` (设置 Node 版本)
|
||||
|
||||
点击 `保存并部署`。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Login to your Cloudflare account and navigate to "Pages" page.
|
||||
|
||||
Click "Create a project" and "Connect to Git", then select your GitHub or GitLab repository and click "Begin setup".
|
||||
Click `Create a project` and `Connect to Git`, then select your GitHub or GitLab repository and click `Begin setup`.
|
||||
|
||||
Select your Production branch, set "Build output directory" to `dist` and add an environment variable.
|
||||
Select your Production branch, set `Build output directory` to `dist` and add an environment variable.
|
||||
|
||||
Set "Variable name" to `NODE_VERSION` and "Value" to `16.0`, then click "Save and Deploy".
|
||||
> `NODE_VERSION`: `16` (Set Node version)
|
||||
|
||||
Then click "Save and Deploy".
|
||||
:::
|
||||
|
||||
#### 其他 {lang="zh-CN"}
|
||||
|
|
|
@ -124,7 +124,7 @@ npm init valaxy
|
|||
```
|
||||
|
||||
::: zh-CN
|
||||
> 由于 `npm init` 缓存您此前下载的版本,我更推荐您使用 `pnpm` 来创建模版。
|
||||
> 由于 `npm init` 会缓存您此前下载的版本,我更推荐您使用 `pnpm` 来创建模版。
|
||||
> 安装 [pnpm](https://pnpm.io/):`npm i -g pnpm`
|
||||
:::
|
||||
|
||||
|
@ -141,7 +141,7 @@ pnpm create valaxy
|
|||
跟随命令行提示完成创建!
|
||||
|
||||
> 默认使用主题 [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/),当然您也可以安装使用任意其他主题。
|
||||
> 本文档同样是一个 Valaxy 主题 [valaxy-theme-press](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-press/)。
|
||||
> 本文档同样是一个 Valaxy 主题 [valaxy-theme-press](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-press/),它的灵感来自 VitePress。
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
@ -258,6 +258,10 @@ npm i valaxy-theme-yun@latest
|
|||
pnpm up --latest -i
|
||||
```
|
||||
|
||||
## 迁移
|
||||
|
||||
如果你来自其他博客框架,可参考 [迁移](/migration/)。
|
||||
|
||||
## Directory Structure {lang="en"}
|
||||
|
||||
## 目录结构 {lang="zh-CN"}
|
||||
|
|
|
@ -4,6 +4,7 @@ title: Migrate from Hexo to Valaxy
|
|||
categories:
|
||||
- Migration
|
||||
end: true
|
||||
top: 9
|
||||
---
|
||||
|
||||
## 迁移步骤 {lang="zh-CN"}
|
||||
|
@ -67,75 +68,3 @@ Refer to [Valaxy Config](/guide/config) to migrate configurations from Hexo's `_
|
|||
::: en
|
||||
For more complex migration examples, you can also compare [hexo branch](https://github.com/YunYouJun/yunyoujun.github.io/tree/hexo) and [valaxy branch](https://github.com/YunYouJun/yunyoujun.github.io/tree/valaxy) in [yunyoujun.github.io | GitHub](https://github.com/YunYouJun/yunyoujun.github.io) to see the similarities and differences.
|
||||
:::
|
||||
|
||||
## 常见问题 {lang="zh-CN"}
|
||||
|
||||
## Common Problems {lang="en"}
|
||||
|
||||
### 摘要截断符 {lang="zh-CN"}
|
||||
|
||||
### Read More Separator {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
默认为 `<!-- more -->`,`more` 前后需有空格。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Default to `<-- More -->`, there are spaces before and after `more`.
|
||||
:::
|
||||
|
||||
### Markdown 换行 {lang="zh-CN"}
|
||||
|
||||
### Newline in Markdown {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 的 Markdown 解析基于 [`markdown-it`](https://github.com/markdown-it/markdown-it) 实现。
|
||||
|
||||
`markdown-it` 的策略在 Markdown 中换行后渲染的内容并没有换行:
|
||||
|
||||
```md
|
||||
第一行
|
||||
没有换行
|
||||
```
|
||||
|
||||
第一行
|
||||
没有换行
|
||||
|
||||
---
|
||||
|
||||
如果需要正常换行,需在末尾添加两个空格:
|
||||
|
||||
```md
|
||||
第一行(末尾有两个空格)
|
||||
换行了
|
||||
```
|
||||
|
||||
第一行(末尾有两个空格)
|
||||
换行了
|
||||
:::
|
||||
|
||||
::: en
|
||||
Markdown rendering in Valaxy is based on [`markdown-it`](https://github.com/markdown-it/markdown-it).
|
||||
|
||||
The default strategy of `markdown-it` does not wrap the rendered content when wrapping in Markdown:
|
||||
|
||||
```md
|
||||
first line
|
||||
second line but not wrapped
|
||||
```
|
||||
|
||||
first line
|
||||
second line but not wrapped
|
||||
|
||||
---
|
||||
|
||||
If you want to move the second line to a new line, add two spaces at the end of the first line:
|
||||
|
||||
```md
|
||||
first line (with two spaces at the end)
|
||||
second line got wrapped corrently
|
||||
```
|
||||
|
||||
first line (with two spaces at the end)
|
||||
second line got wrapped corrently
|
||||
:::
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
title: Migration from Other
|
||||
title_zh-CN: 从其他博客框架迁移
|
||||
categories:
|
||||
- Migration
|
||||
top: 10
|
||||
---
|
||||
|
||||
## 从 Hexo 迁移至 Valaxy
|
||||
|
||||
- [从 Hexo 迁移至 Valaxy](/migration/hexo)
|
||||
|
||||
## 从其他任意博客框架迁移
|
||||
|
||||
- 将你的文章(Markdown 文件)复制至 Valaxy `pages/posts` 目录下。
|
||||
- 将你的自定义页面(非文章的 Markdown/HTML 文件)复制至 Valaxy `pages` 目录下。
|
||||
- 将你的静态资源(图片等)复制至 Valaxy `public` 目录下。
|
||||
- 参考 [配置](/guide/config) 配置你的配置文件 `valaxy.config.ts`/`site.config.ts`。
|
||||
|
||||
## 常见问题 {lang="zh-CN"}
|
||||
|
||||
## Common Problems {lang="en"}
|
||||
|
||||
### 摘要截断符 {lang="zh-CN"}
|
||||
|
||||
### Read More Separator {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
默认为 `<!-- more -->`,`more` 前后需有空格。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Default to `<-- More -->`, there are spaces before and after `more`.
|
||||
:::
|
||||
|
||||
### Markdown 换行 {lang="zh-CN"}
|
||||
|
||||
### Newline in Markdown {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 的 Markdown 解析基于 [`markdown-it`](https://github.com/markdown-it/markdown-it) 实现。
|
||||
|
||||
`markdown-it` 的策略在 Markdown 中换行后渲染的内容并没有换行:
|
||||
|
||||
```md
|
||||
第一行
|
||||
没有换行
|
||||
```
|
||||
|
||||
第一行
|
||||
没有换行
|
||||
|
||||
---
|
||||
|
||||
如果需要正常换行,需在末尾添加两个空格:
|
||||
|
||||
```md
|
||||
第一行(末尾有两个空格)
|
||||
换行了
|
||||
```
|
||||
|
||||
第一行(末尾有两个空格)
|
||||
换行了
|
||||
:::
|
||||
|
||||
::: en
|
||||
Markdown rendering in Valaxy is based on [`markdown-it`](https://github.com/markdown-it/markdown-it).
|
||||
|
||||
The default strategy of `markdown-it` does not wrap the rendered content when wrapping in Markdown:
|
||||
|
||||
```md
|
||||
first line
|
||||
second line but not wrapped
|
||||
```
|
||||
|
||||
first line
|
||||
second line but not wrapped
|
||||
|
||||
---
|
||||
|
||||
If you want to move the second line to a new line, add two spaces at the end of the first line:
|
||||
|
||||
```md
|
||||
first line (with two spaces at the end)
|
||||
second line got wrapped corrently
|
||||
```
|
||||
|
||||
first line (with two spaces at the end)
|
||||
second line got wrapped corrently
|
||||
:::
|
|
@ -47,8 +47,8 @@ export default defineValaxyConfig<PressTheme.Config>({
|
|||
link: '/guide/getting-started',
|
||||
},
|
||||
{
|
||||
text: 'Migration from Hexo',
|
||||
link: '/migration/hexo',
|
||||
text: 'Migration from Other',
|
||||
link: '/migration/',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
This is a theme for valaxy docs.
|
||||
|
||||
Inspired by [vitepress](https://vitepress.dev).
|
||||
|
||||
## Reference
|
||||
|
||||
- [vitepress](https://vitepress.vuejs.org/)
|
||||
|
|
Loading…
Reference in New Issue