Skip to content

prer#107

Merged
erduotong merged 7 commits into
Nuitka-Commander:mainfrom
erduotong:main
Jun 1, 2025
Merged

prer#107
erduotong merged 7 commits into
Nuitka-Commander:mainfrom
erduotong:main

Conversation

@erduotong

Copy link
Copy Markdown
Collaborator

This pull request introduces SEO optimization features to the project, enabling pre-rendering of static pages for improved search engine visibility. The changes include updates to workflows, scripts, and documentation, as well as the addition of new dependencies and plugins to support SEO builds. Below is a summary of the most important changes:

Workflow Enhancements for SEO Builds:

  • .github/workflows/build_and_publish.yml: Added an optional enable_seo input to allow SEO optimization during version publishing. Updated steps to install Playwright and run SEO-specific build commands when enabled. [1] [2] [3]
  • .github/workflows/build_beta.yml: Introduced a build_type input with options for local_use, website, and website_seo. Updated steps to conditionally install Playwright and execute the appropriate build based on the selected type. [1] [2]

SEO Build Features and Documentation:

  • docs/SEO_BUILD_GUIDE.md: Added detailed documentation outlining the SEO build process, including features, local testing, deployment steps, and troubleshooting tips.
  • package.json: Added new scripts for SEO builds (build:website:seo, test:seo) and dependencies such as playwright, cross-env, and fs-extra to support SEO functionality.

Code Changes for SEO Optimization:

  • plugins/vite-prerender.js: Implemented a Vite plugin for pre-rendering static pages using Playwright. Includes concurrency optimization, crawler detection script injection, and generation of sitemap.xml and robots.txt.

Metadata and Content Updates:

  • index.html: Updated meta tags to improve SEO, including enhanced descriptions, keywords, and author information. Added canonical URL support for pre-rendered pages.
  • README.md: Updated the link to the project's webpage to reflect the new domain.

erduotong and others added 7 commits June 1, 2025 16:54
新增 robots.txt 文件以控制搜索引擎爬虫的访问权限,并添加 sitemap.xml 文件以便于搜索引擎索引网站内容。

- robots.txt 允许所有用户代理访问,并禁止访问不必要的文件。
- sitemap.xml 提供网站的结构信息,帮助搜索引擎更好地抓取页面。
- Updated pnpm workspace to include puppeteer as a built dependency.
- Implemented prerendering in App.vue to mark the page as ready for SEO.
- Enhanced vite.config.js to integrate the vite-prerender plugin for static page generation.
- Created comprehensive SEO_BUILD_GUIDE.md for instructions on SEO build process.
- Developed vite-prerender.js plugin to handle page rendering with Playwright.
- Configured prerender.config.js to define page combinations for prerendering.
- Added PowerShell script for building SEO optimized versions with prerendering.
- Implemented crawler detection in server/crawler-detection.js to serve static pages for bots.
实现了客户端爬虫检测脚本,能够在静态部署环境中识别爬虫并进行相应处理。
同时,增加了SEO重定向逻辑,确保用户访问时能够正确导航到SPA应用。

- 在静态页面中注入爬虫检测脚本。
- 处理SEO重定向路径,支持多语言和版本参数。
- 更新了SEO功能测试脚本以验证新功能。

Closes #123
修改了预渲染配置以支持生成 sitemap.xml 和 robots.txt 文件。
更新了相关的构建脚本和测试脚本,移除了不再使用的文件。

- 修改了 `vite-prerender.js` 以生成 sitemap 和 robots.txt。
- 更新了 `prerender.config.js` 的基础 URL。
- 移除了不再需要的 PowerShell 构建脚本和爬虫检测服务器。
调整了构建流程中的 Node.js 安装步骤,添加了 pnpm 缓存配置,以提高依赖安装的效率。

- 在 Node.js 安装步骤中添加了缓存配置。
@erduotong erduotong merged commit 992ca3e into Nuitka-Commander:main Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant