Skip to content

从 WordPress 迁移

WordPress 是一个基于 PHP 和 MySQL 构建的开源个人发布系统。

¥WordPress is an open-source, personal publishing system built on PHP and MySQL.

WordPress 和 Astro 之间的主要相似之处

Section titled WordPress 和 Astro 之间的主要相似之处

¥Key Similarities between WordPress and Astro

WordPress 和 Astro 有一些相似之处,可以帮助你迁移项目:

¥WordPress and Astro share some similarities that will help you migrate your project:

WordPress 和 Astro 之间的主要区别

Section titled WordPress 和 Astro 之间的主要区别

¥Key Differences between WordPress and Astro

当你在 Astro 中重建 WordPress 网站时,你会注意到一些重要的差异:

¥When you rebuild your WordPress site in Astro, you will notice some important differences:

  • WordPress 网站是使用在线仪表板进行编辑的。在 Astro 中,你将使用 代码编辑器 和开发环境来维护你的站点。你可以在计算机上进行本地开发,也可以选择云编辑器/开发环境,例如 StackBlitz、CodeSandbox 或 Gitpod。

  • WordPress 拥有广泛的插件和主题市场。在 Astro 中,你会发现一些主题和 integrations 可用,但你现在可能必须自己构建许多现有功能,而不是寻找第三方解决方案。或者,你可以选择从具有内置功能的 Astro 主题 开始!

  • WordPress 将你的内容存储在数据库中。在 Astro 中,你的 项目目录 中将为每个页面的内容提供单独的文件(通常为 Markdown 或 MDX)。或者,你可以选择使用 适合你内容的 CMS,甚至是你现有的 WordPress 网站,并使用 Astro 来获取和渲染数据。

¥Switch from WordPress to Astro

要将 WordPress 博客转换为 Astro,请从我们的博客主题入门模板开始,或者在我们的 主题展示 中探索更多社区博客主题。

¥To convert a WordPress blog to Astro, start with our blog theme starter template, or explore more community blog themes in our theme showcase.

你可以将 --template 参数传递给 create astro 命令,以使用我们的官方启动器之一启动一个新的 Astro 项目。或者,你可以 从 GitHub 上任何现有的 Astro 存储库启动一个新项目

¥You can pass a --template argument to the create astro command to start a new Astro project with one of our official starters. Or, you can start a new project from any existing Astro repository on GitHub.

Terminal window
npm create astro@latest -- --template blog

你可以继续到 使用你现有的 WordPress 博客作为 Astro 的 CMS,这意味着你将继续使用 WordPress 仪表板来撰写帖子。你的内容将在 WordPress 上进行管理,但 Astro 网站的所有其他方面都将构建在你的代码编辑环境中,并且你将与 WordPress 网站分开进行 部署你的 Astro 站点。(请务必更新主机上的域名以保持相同的网站 URL!)

¥You can continue to use your existing WordPress blog as your CMS for Astro, which means you will keep using your WordPress dashboard for writing your posts. Your content will be managed at WordPress, but all other aspects of your Astro site will be built in your code editing environment, and you will deploy your Astro site separately from your WordPress site. (Be sure to update your domain at your host to keep the same website URL!)

如果你不熟悉代码编辑器以及使用 GitHub 存储和部署站点,你可能希望参加 Astro 的建立博客教程。它将引导你完成所需的所有账户和设置!你还将学习如何 自己构建 Astro 组件,如果你选择不使用 WordPress 编写内容,它将向你展示如何 直接在 Astro 中添加博客文章

¥You may wish to take Astro’s Build a Blog Tutorial if you are new to working in a code editor and using GitHub to store and deploy your site. It will walk you through all the accounts and setup you need! You will also learn how to build Astro components yourself, and it will show you how to add blog posts directly in Astro if you choose not to use WordPress to write your content.

如果你想将所有现有帖子内容移至 Astro,你可能会找到此 从 WordPress 导出 Markdown 的工具很有帮助。如果必须 将大型或复杂的 WordPress 网站转换为 Markdown,你可能需要对结果进行一些调整。

¥If you want to move all of your existing post content to Astro, you may find this tool for exporting Markdown from WordPress helpful. You may need to make some adjustments to the result if you have to convert a large or complicated WordPress site to Markdown.

要转换其他类型的网站,例如作品集或文档网站,请参阅 astro.new 上的更多官方入门模板。你将找到每个项目的 GitHub 存储库的链接,以及用于在 StackBlitz、CodeSandbox 和 Gitpod 在线开发环境中打开工作项目的一键链接。

¥To convert other types of sites, such as a portfolio or documentation site, see more official starter templates on astro.new. You’ll find a link to each project’s GitHub repository, as well as one-click links to open a working project in StackBlitz, CodeSandbox and Gitpod online development environments.

¥Community Resources

More migration guides

Astro 中文网 - 粤ICP备13048890号