Skip to content

Commit a00a011

Browse files
committed
配置 GitHub Pages 部署
设置 baseUrl、routeBasePath,修正语言切换和自动跳转路径。
1 parent 776499d commit a00a011

13 files changed

Lines changed: 51 additions & 40 deletions

File tree

‎docs/getting-started/quick-start.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ This works with any OpenAI-compatible API, including self-hosted models.
9595

9696
4. If the command matches a **deny** policy, it will be blocked. If it requires confirmation, you will see a prompt before execution.
9797

98-
All actions are logged in the [Audit Log](/docs/guide/audit) with full decision tracking.
98+
All actions are logged in the [Audit Log](/guide/audit) with full decision tracking.
9999

100100
## What's Next
101101

102-
- [Asset Management](/docs/guide/asset-management) — Organize assets into groups, import/export
103-
- [SSH Terminal](/docs/guide/ssh-terminal) — Split pane, SFTP, jump hosts, port forwarding
104-
- [AI Agent](/docs/guide/ai-agent) — Provider configuration, tools, policy enforcement
105-
- [Query Editor](/docs/guide/query-editor) — SQL and Redis query editor
106-
- [Policy](/docs/guide/policy) — Configure allow/deny rules
107-
- [Audit](/docs/guide/audit) — Review audit logs and approval workflows
102+
- [Asset Management](/guide/asset-management) — Organize assets into groups, import/export
103+
- [SSH Terminal](/guide/ssh-terminal) — Split pane, SFTP, jump hosts, port forwarding
104+
- [AI Agent](/guide/ai-agent) — Provider configuration, tools, policy enforcement
105+
- [Query Editor](/guide/query-editor) — SQL and Redis query editor
106+
- [Policy](/guide/policy) — Configure allow/deny rules
107+
- [Audit](/guide/audit) — Review audit logs and approval workflows

‎docs/guide/ai-agent.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Every tool call from the AI agent passes through the same policy pipeline as man
8484

8585
The AI agent can proactively call `request_permission` to submit command patterns for batch approval, reducing the number of individual confirmations.
8686

87-
See [Policy Enforcement](/docs/guide/policy) for details on configuring rules.
87+
See [Policy Enforcement](/guide/policy) for details on configuring rules.
8888

8989
## AI Coding Tool Integration
9090

‎docs/guide/asset-management.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Groups organize assets into a tree hierarchy using parent-child relationships. E
4747

4848
- Create nested groups for environments (e.g., Production > Web Servers)
4949
- Assets and groups can be reordered via drag-and-drop
50-
- Groups can have their own [policy configurations](/docs/guide/policy), inherited by child assets
50+
- Groups can have their own [policy configurations](/guide/policy), inherited by child assets
5151

5252
## Adding, Editing, and Deleting Assets
5353

‎docs/guide/query-editor.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OpsKat uses **TiDB Parser** to analyze SQL statements before execution. This pow
3030
- `DELETE` or `UPDATE` without a `WHERE` clause
3131
- `PREPARE` statements
3232
- `CALL` statements
33-
- **Policy enforcement** — Statement types and flags are checked against the asset's [query policy](/docs/guide/policy) before execution
33+
- **Policy enforcement** — Statement types and flags are checked against the asset's [query policy](/guide/policy) before execution
3434

3535
## Result Tables
3636

@@ -70,7 +70,7 @@ The key browser provides a visual interface for exploring Redis data:
7070

7171
## Policy Enforcement
7272

73-
All queries and commands executed through the Query Editor are subject to the same [policy rules](/docs/guide/policy) as AI Agent operations:
73+
All queries and commands executed through the Query Editor are subject to the same [policy rules](/guide/policy) as AI Agent operations:
7474

7575
- **SQL** — Checked against the asset's query policy (allowed/denied statement types, dangerous pattern flags)
7676
- **Redis** — Checked against the asset's Redis policy (allowed/denied command patterns)

‎docusaurus.config.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config: Config = {
1515
},
1616

1717
url: "https://opskat.github.io",
18-
baseUrl: "/",
18+
baseUrl: "/docs/",
1919

2020
organizationName: "opskat",
2121
projectName: "docs",
@@ -54,6 +54,7 @@ const config: Config = {
5454
"classic",
5555
{
5656
docs: {
57+
routeBasePath: "/",
5758
sidebarPath: "./sidebars.ts",
5859
editUrl: "https://github.com/opskat/docs/tree/main/",
5960
},

‎i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/quick-start.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ AI 智能体允许你通过自然语言管理基础设施。使用前需要先
9595

9696
4. 如果命令匹配了**拒绝**策略,将被阻止。如果需要确认,执行前会提示你进行审批。
9797

98-
所有操作都记录在[审计日志](/docs/guide/audit)中,包含完整的决策追踪。
98+
所有操作都记录在[审计日志](/guide/audit)中,包含完整的决策追踪。
9999

100100
## 下一步
101101

102-
- [资产管理](/docs/guide/asset-management) — 将资产分组管理、导入/导出
103-
- [SSH 终端](/docs/guide/ssh-terminal) — 分屏、SFTP、跳板机、端口转发
104-
- [AI 智能体](/docs/guide/ai-agent) — 提供商配置、工具、策略执行
105-
- [查询编辑器](/docs/guide/query-editor) — SQL 和 Redis 查询编辑器
106-
- [策略](/docs/guide/policy) — 配置允许/拒绝规则
107-
- [审计](/docs/guide/audit) — 查看审计日志和审批工作流
102+
- [资产管理](/guide/asset-management) — 将资产分组管理、导入/导出
103+
- [SSH 终端](/guide/ssh-terminal) — 分屏、SFTP、跳板机、端口转发
104+
- [AI 智能体](/guide/ai-agent) — 提供商配置、工具、策略执行
105+
- [查询编辑器](/guide/query-editor) — SQL 和 Redis 查询编辑器
106+
- [策略](/guide/policy) — 配置允许/拒绝规则
107+
- [审计](/guide/audit) — 查看审计日志和审批工作流

‎i18n/zh-CN/docusaurus-plugin-content-docs/current/guide/ai-agent.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ AI 智能体的每次工具调用都会经过与手动操作相同的策略管
8484

8585
AI 智能体可以主动调用 `request_permission` 提交命令模式进行批量审批,减少逐条确认的次数。
8686

87-
详见[策略执行](/docs/guide/policy)了解规则配置。
87+
详见[策略执行](/guide/policy)了解规则配置。
8888

8989
## AI 编程工具集成
9090

‎i18n/zh-CN/docusaurus-plugin-content-docs/current/guide/asset-management.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ OpsKat 将你的基础设施组织为树状结构的资产清单。资产代表
4747

4848
- 创建嵌套分组来区分环境(例如"生产环境 > Web 服务器")
4949
- 资产和分组可以通过拖拽重新排序
50-
- 分组可以有自己的[策略配置](/docs/guide/policy),子资产会继承这些策略
50+
- 分组可以有自己的[策略配置](/guide/policy),子资产会继承这些策略
5151

5252
## 添加、编辑和删除资产
5353

‎i18n/zh-CN/docusaurus-plugin-content-docs/current/guide/query-editor.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OpsKat 使用 **TiDB Parser** 在执行前分析 SQL 语句。这提供了以下
3030
- 不带 `WHERE` 子句的 `DELETE` 或 `UPDATE`
3131
- `PREPARE` 语句
3232
- `CALL` 语句
33-
- **策略执行** — 语句类型和标记会在执行前与资产的[查询策略](/docs/guide/policy)进行比对
33+
- **策略执行** — 语句类型和标记会在执行前与资产的[查询策略](/guide/policy)进行比对
3434

3535
## 结果表格
3636

@@ -70,7 +70,7 @@ INFO server
7070

7171
## 策略执行
7272

73-
通过查询编辑器执行的所有查询和命令都与 AI 智能体操作遵循相同的[策略规则](/docs/guide/policy):
73+
通过查询编辑器执行的所有查询和命令都与 AI 智能体操作遵循相同的[策略规则](/guide/policy):
7474

7575
- **SQL** — 根据资产的查询策略检查(允许/拒绝的语句类型、危险模式标记)
7676
- **Redis** — 根据资产的 Redis 策略检查(允许/拒绝的命令模式)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
2+
import siteConfig from "@generated/docusaurus.config";
23

34
if (ExecutionEnvironment.canUseDOM) {
45
const STORAGE_KEY = "opskat_locale_redirected";
6+
const baseUrl = siteConfig.baseUrl; // e.g. "/docs/"
57

68
// Only redirect on first visit and if on the default (en) locale root
79
if (
810
!localStorage.getItem(STORAGE_KEY) &&
9-
(window.location.pathname === "/" || window.location.pathname === "")
11+
(window.location.pathname === baseUrl ||
12+
window.location.pathname === baseUrl.replace(/\/$/, ""))
1013
) {
1114
localStorage.setItem(STORAGE_KEY, "1");
1215

1316
const lang = navigator.language || navigator.languages?.[0] || "";
1417
if (lang.startsWith("zh")) {
15-
window.location.replace("/zh-CN/");
18+
window.location.replace(`${baseUrl}zh-CN/`);
1619
}
1720
}
1821
}

0 commit comments

Comments
 (0)