Migration from Other

从 Hexo 迁移至 Valaxy

Migrate from Hexo to Valaxy

迁移内容

Migrate Contents

Hexo 博客目录与 Valaxy 博客目录对应关系如下,将相关内容复制至对应文件夹即可。

譬如迁移文章,即将 Hexo source/_posts 目录下内容复制至 Valaxy pages/posts 目录下。

用途HexoValaxy
文章(Markdown 文件)source/_postspages/posts
页面(Markdown / Html)sourcepages
静态资源(*.js / *.css / CNAME etc.)sourcepublic

The relationship between Hexo blog directory and Valaxy blog directory is shown in the table below. Just copy the relevant contents to the corresponding folder.

For example: To migrate articles, just copy files from Hexo’s source/_posts to Valaxy’s pages/posts directory.

ContentsHexoValaxy
Posts (Markdown files)source/_postspages/posts
Pages (Markdown / Html files)sourcepages
Static assets (*.js / *.css / CNAME etc.)sourcepublic

迁移配置

Migrate Configurations

参考 Valaxy 配置文档 将 Hexo _config.yml 配置文件中的内容,迁移至 valaxy.config.ts 文件中。

配置示例:demo/yun/valaxy.config.tsyunyoujun.github.io/valaxy.config.tsvalaxy.config.ts 提供了完备的类型提示,这意味着你在 VSCode 中可以直接鼠标悬浮查看各参数注释。

Refer to Valaxy Config to migrate configurations from Hexo’s _config.yml to Valaxy’s valaxy.config.ts.

Examples of configuration: demo/yun/valaxy.config.ts, yunyoujun.github.io/valaxy.config.ts. valaxy.config.ts provides a complete type prompt, which means that you can hover on configuration fields directly to view the comments in VSCode.

示例

Example

更复杂的迁移示例,您还可以对比 yunyoujun.github.io | GitHub 仓库 hexo 分支与 valaxy 的异同。

For more complex migration examples, you can also compare hexo branch and valaxy branch in yunyoujun.github.io | GitHub to see the similarities and differences.

从其他任意博客框架迁移

Migrate from any other blog framework

  • 将你的文章(Markdown 文件)复制至 Valaxy pages/posts 目录下。
  • 将你的自定义页面(非文章的 Markdown/HTML 文件)复制至 Valaxy pages 目录下。
  • 将你的静态资源(图片等)复制至 Valaxy public 目录下。
  • 参考 配置 配置你的配置文件 valaxy.config.ts/site.config.ts
  • Copy your posts (Markdown files) to the Valaxy pages/posts directory.
  • Copy your custom pages (non-article Markdown/HTML files) to the Valaxy pages directory.
  • Copy your static resources (images, etc.) to the Valaxy public directory.
  • Configure your configuration file valaxy.config.ts/site.config.ts by referring to configuration.

常见问题

Common Problems

摘要截断符

Read More Separator

默认为 <!-- more -->more 前后需有空格。

Default to <-- More -->, there are spaces before and after more.

Markdown 换行

Newline in Markdown

Valaxy 的 Markdown 解析基于 markdown-it 实现。

没有换行

markdown-it 的策略在 Markdown 中换行后渲染的内容并没有换行:

md
第一行
没有换行

第一行 没有换行


换行了

如果需要正常换行,需在末尾添加两个空格:

md
第一行(末尾有两个空格)  
换行了

第一行(末尾有两个空格)
换行了

Markdown rendering in Valaxy is based on 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

Contributors