-
Notifications
You must be signed in to change notification settings - Fork 1
docs: add og:title and fix punctuation in docs #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6767191
1310a6f
ba6bb44
95ef7a6
a4fc078
3f745f7
7eb098b
3a20d1a
c4f9019
7b27604
1bca05c
765b4aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| alwaysApply: true | ||
| scene: git_message | ||
| --- | ||
| ### 基本格式 | ||
|
|
||
| 每条提交信息应遵循以下结构(只允许使用英文): | ||
|
|
||
| ```text | ||
| <类型(英文)>(<作用域>): <描述(英文)> | ||
|
|
||
| [正文(英文)] | ||
|
|
||
| [脚注(英文)] | ||
| ``` | ||
|
|
||
| - **类型**:必填,表示本次提交的类别(见下文“类型列表”)。 | ||
| - **作用域**:可选,用括号包裹,指明本次提交影响的代码范围(如模块名、组件名等)。 | ||
| - **描述**:必填,是对变更的简短说明,使用祈使句、现在时态,首字母小写,末尾不加句号。 | ||
| - **正文**:可选,对变更动机及与之前行为的对比进行详细说明。 | ||
| - **脚注**:可选,主要用于关联 Issue 或标记破坏性变更(BREAKING CHANGE)。 | ||
|
|
||
| ### 允许的类型列表 | ||
|
|
||
| - `feat`:新增功能。 | ||
| - `fix`:修复 bug。 | ||
| - `update`: 对代码内容做出调整,而原先的代码不视为 bug(如修改前端按钮的文案) | ||
| - `docs`:仅修改文档。 | ||
| - `style`:修改代码格式(不影响代码运行的变动,如空格、分号缺失等)。 | ||
| - `refactor`:重构代码(既不是新增功能,也不是修改 bug 的代码变动)。 | ||
| - `perf`:优化性能。 | ||
| - `test`:增加测试或修改现有测试。 | ||
| - `ci`:修改 CI 配置文件或脚本(例如:Travis, Circle, BrowserStack, SauceLabs)。 | ||
| - `chore`:其他不修改源代码或测试文件的更改。 | ||
| - `revert`:撤销之前的提交。 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,15 +83,30 @@ export async function generateMetadata({ | |
| if (!page) notFound(); | ||
| const cleanSlug = slug ? slug : []; | ||
| const currentPage = cleanSlug.join("/"); | ||
| const url = `${baseUrl}/${lang}/${currentPage}`; | ||
| return { | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| alternates: { | ||
| canonical: url, | ||
| languages: { | ||
| zh: `${baseUrl}/zh/${currentPage}`, | ||
| en: `${baseUrl}/en/${currentPage}`, | ||
| "x-default": `${baseUrl}/en/${currentPage}`, | ||
|
Comment on lines
+86
to
95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normalize root-page canonical/alternate URLs. At Line 86, when Suggested fix- const currentPage = cleanSlug.join("/");
- const url = `${baseUrl}/${lang}/${currentPage}`;
+ const currentPage = cleanSlug.join("/");
+ const slugPath = currentPage ? `/${currentPage}` : "";
+ const url = `${baseUrl}/${lang}${slugPath}`;
return {
@@
alternates: {
canonical: url,
languages: {
- zh: `${baseUrl}/zh/${currentPage}`,
- en: `${baseUrl}/en/${currentPage}`,
- "x-default": `${baseUrl}/en/${currentPage}`,
+ zh: `${baseUrl}/zh${slugPath}`,
+ en: `${baseUrl}/en${slugPath}`,
+ "x-default": `${baseUrl}/en${slugPath}`,
},
},🤖 Prompt for AI Agents |
||
| }, | ||
| }, | ||
| openGraph: { | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| url, | ||
| siteName: "Project CVSA", | ||
| locale: lang === "zh" ? "zh_CN" : "en_US", | ||
| type: "article", | ||
| }, | ||
| twitter: { | ||
| card: "summary_large_image", | ||
| title: page.data.title, | ||
| description: page.data.description, | ||
| }, | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| import type { MetadataRoute } from 'next' | ||
|
|
||
| export default function sitemap(): MetadataRoute.Sitemap { | ||
| return [ | ||
| { | ||
| url: 'https://docs.projectcvsa.com/', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 1, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/en', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.8, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.9, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/scope-of-inclusion', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.5, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.5, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/guide', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.4, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/architecture', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.4, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/hld', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.33, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/style-guide', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.33, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/workflow', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.33, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/developers/crawler/overview', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.26, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/architecture-overview', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.3, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/crawling-lifecycle', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/video-discovery-pipeline', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/song-collection-pipeline', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/snapshot-scheduling', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/snapshot-execution', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/message-queue-reference', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/database-schema-reference', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| { | ||
| url: 'https://docs.projectcvsa.com/zh/internal/legacy/network-proxy-architecture', | ||
| lastModified: new Date(), | ||
| changeFrequency: 'weekly', | ||
| priority: 0.2, | ||
| }, | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| title: 项目架构 | ||
| description: 了解档案馆的项目组织架构。 | ||
| og:title: Project CVSA 项目架构 | ||
| --- | ||
|
|
||
| ## 目录结构 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| "title": "爬虫架构" | ||
| "title": "爬虫架构", | ||
| "og:title": "Project CVSA 爬虫架构" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| title: 新爬虫架构概览 | ||
| description: CVSA 2.0 爬虫系统的总体设计、核心设计目标与节点角色定义 | ||
| og:title: 新爬虫架构概览 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align Line 4 uses 🤖 Prompt for AI Agents |
||
| --- | ||
|
|
||
| ## 设计目标 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| title: 开发者指南 | ||
| description: 了解如何参与档案馆的开发工作。 | ||
| og:title: Project CVSA 开发开发者指南 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix duplicated wording in Line 4 currently has 🤖 Prompt for AI Agents |
||
| --- | ||
|
|
||
| ## 准备环境 | ||
|
|
@@ -43,23 +44,32 @@ cp apps/backend/.env.example apps/backend/.env | |
| cp apps/backend/.env.example apps/backend/.env.test | ||
| ``` | ||
|
|
||
| 为了避免开发和测试环境冲突,你需要将所有 `.env.test` 中的 `DATABASE_URL` 修改为用于测试的数据库。例如: | ||
| 为了避免开发和测试环境冲突,你需要将所有 `.env.test` 中的 `DATABASE_URL`、`MEILI_API_URL` 和 `REDIS_URL` 修改为用于测试的地址。例如: | ||
| ```bash | ||
| # 在 .env 中 | ||
| DATABASE_URL=postgres://cvsa:password@localhost:5432/cvsa | ||
| MEILI_API_URL=http://localhost:7700 | ||
| REDIS_URL=redis://localhost:6379 | ||
| # 在 .env.test 中 | ||
| DATABASE_URL=postgres://cvsa:password@localhost:5432/cvsa_test | ||
| MEILI_API_URL=http://localhost:7700 | ||
| REDIS_URL=redis://localhost:6379 | ||
| ``` | ||
|
|
||
| 如果`.env`和`.env.test`中缺少`REDIS_URL`可以手动添加(通常只需要在`/packages/core/`中的`.env`和`.env.test`添加)。不要修改`.ts`文件中的默认值。 | ||
| `MEILI_MASTER_KEY`、`cvsa`和`password`如需修改需要和`.env.docker`文件中的值一致。 | ||
|
|
||
| ## 启动外部服务 | ||
|
|
||
| 你需要准备一个 PostgreSQL 18 以及 MeiliSearch 1.40 实例来辅助开发和调试。推荐使用 Docker,因为它易于管理和隔离。 | ||
| 确保你安装了 [Docker Compose](https://docs.docker.com/compose/install/),之后便可以在根路径下通过 compose 拉起这两个容器。 | ||
| 你需要准备一个 PostgreSQL 18 、Redis 7 以及 MeiliSearch 1.40 实例来辅助开发和调试。推荐使用 Docker,因为它易于管理和隔离。 | ||
| 确保你安装了 [Docker Compose](https://docs.docker.com/compose/install/),之后便可以在根路径下通过 compose 拉起这三个容器。 | ||
|
|
||
| ```bash | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| 如果 Docker 服务不在本机,可能需要使用`docker-compose-remote.yml`来启动服务。需要将`.env.docker`一起复制到远端配置目录。 | ||
|
|
||
| ## 初始化项目 | ||
|
|
||
| 在开始开发前,需要安装依赖并运行初始化脚本。 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| "title": "开发文档" | ||
| "title": "开发文档", | ||
| "og:title": "Project CVSA 开发文档" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| title: 代码风格指南 | ||
| description: 档案馆项目的代码风格、架构决策及类型安全规范。 | ||
| og:title: Project CVSA 代码风格指南 | ||
| --- | ||
|
|
||
| ## TypeScript 代码规范 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| --- | ||
| title: 流程规范 | ||
| description: 了解档案馆的开发工作流和相关规范。 | ||
| og:title: Project CVSA 流程规范 | ||
| --- | ||
|
|
||
| ## 分支命名 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||
| --- | ||||||
| title: 一次完整爬取的生命周期 | ||||||
| description: 从视频发现到成就追踪的全流程示例,展示爬虫系统如何处理一个新视频的完整生命周期 | ||||||
| description: 从视频发现到成就追踪的全流程示例,展示爬虫系统如何处理一个新视频的完整生命周期。 | ||||||
| og:title: 一次完整爬取的生命周期 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unify Line 4 uses a different pattern from the standardized Suggested fix-og:title: 一次完整爬取的生命周期
+og:title: Project CVSA 一次完整爬取的生命周期📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| --- | ||||||
|
|
||||||
| 以一个**新发现的B站视频**(aid=12345)为例,展示从发现到持续追踪的完整流程。 | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Template placeholders should use English to match the requirement.
The template on line 11 uses Chinese placeholders (
<类型>(<作用域>): <描述>), but line 8 requires all commit messages to be in English. This inconsistency could confuse developers about what language to use.Consider updating the template to use English placeholders for clarity:
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.trae/rules/git-commit-message.md around lines 10 - 16, Update the commit
message template placeholders from Chinese to English: replace occurrences of
"<类型>(<作用域>): <描述>" with "(): ", change "[正文(英文描述)]"
to "[body]" and "[脚注(英文描述)]" to "[footer]", and remove the "(英文描述)" annotations
so the template uses consistent English placeholders (look for the template
block containing those placeholder tokens).