Skip to content

Commit ee26731

Browse files
committed
docs: update pages
1 parent f0cdefb commit ee26731

File tree

6 files changed

+52
-11
lines changed

6 files changed

+52
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ help: ## Display this help.
4545

4646
.PHONY: chglog
4747
chglog: git-chglog ## Generate changelog using git-chglog.
48-
$(GIT_CHGLOG) -o CHANGELOG.md
48+
$(GIT_CHGLOG) -o website/docs/changelog.md
4949

5050
.PHONY: mod-tidy
5151
mod-tidy: ## Run go mod tidy to clean up dependencies.

README_ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ AI-ターミナルの使用例を機能別に紹介します:
147147

148148
### 変更履歴
149149

150-
プロジェクトの詳細な更新と変更については、[CHANGELOG.md](CHANGELOG.md)をご覧ください。
150+
プロジェクトの詳細な更新と変更については、[CHANGELOG.md](website/docs/changelog.md)をご覧ください。
151151

152152
### ライセンス
153153

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ ai commit --diff-unified 3 --lang zh
8888

8989
查看 [CONTRIBUTING_zh.md](CONTRIBUTING_zh.md) 了解贡献指南。
9090

91-
**更新日志:** [CHANGELOG.md](CHANGELOG.md)
91+
**更新日志:** [CHANGELOG.md](website/docs/changelog.md)
9292
**许可证:** [MIT](LICENSE) © 2024 coding-hui

website/docusaurus.config.ts

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {themes as prismThemes} from 'prism-react-renderer';
22
import type {Config} from '@docusaurus/types';
33
import type * as Preset from '@docusaurus/preset-classic';
4+
import type {Options as ClientRedirectsOptions} from '@docusaurus/plugin-client-redirects';
45

5-
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
6+
const defaultLocale = 'en';
67

78
const config: Config = {
89
title: 'AI-Terminal',
@@ -43,10 +44,13 @@ const config: Config = {
4344
{
4445
docs: {
4546
sidebarPath: './sidebars.ts',
46-
// Please change this to your repo.
4747
// Remove this to remove the "edit this page" links.
48-
editUrl:
49-
'https://github.com/coding-hui/ai-terminal/tree/main/website/',
48+
// editUrl: 'https://github.com/coding-hui/ai-terminal/tree/main/website/',
49+
editUrl: ({locale, docPath}) => {
50+
return `https://github.com/coding-hui/ai-terminal/tree/main/website/docs/${docPath}`;
51+
},
52+
showLastUpdateAuthor: true,
53+
showLastUpdateTime: true,
5054
},
5155
blog: {
5256
showReadingTime: true,
@@ -56,8 +60,7 @@ const config: Config = {
5660
},
5761
// Please change this to your repo.
5862
// Remove this to remove the "edit this page" links.
59-
editUrl:
60-
'https://github.com/coding-hui/ai-terminal/tree/main/website/',
63+
editUrl: 'https://github.com/coding-hui/ai-terminal/tree/main/website/',
6164
// Useful options to enforce blogging best practices
6265
onInlineTags: 'warn',
6366
onInlineAuthors: 'warn',
@@ -84,9 +87,9 @@ const config: Config = {
8487
},
8588
items: [
8689
{
87-
type: 'docSidebar',
88-
sidebarId: 'docsSidebar',
90+
type: 'doc',
8991
position: 'left',
92+
docId: 'intro',
9093
label: 'Documentation',
9194
},
9295
// {to: '/blog', label: 'Blog', position: 'left'},
@@ -147,6 +150,28 @@ const config: Config = {
147150
darkTheme: prismThemes.dracula,
148151
},
149152
} satisfies Preset.ThemeConfig,
153+
154+
plugins: [
155+
[
156+
'client-redirects',
157+
{
158+
fromExtensions: ['html'],
159+
createRedirects(routePath) {
160+
// Redirect to /docs from /docs/introduction (now docs root doc)
161+
if (routePath === '/docs' || routePath === '/docs/') {
162+
return [`${routePath}/intro`];
163+
}
164+
return [];
165+
},
166+
redirects: [
167+
{
168+
from: ['/docs/support', '/docs/next/support'],
169+
to: '/community/support',
170+
},
171+
],
172+
} satisfies ClientRedirectsOptions,
173+
]
174+
]
150175
};
151176

152177
export default config;

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@docusaurus/core": "3.9.1",
19+
"@docusaurus/plugin-client-redirects": "^3.9.1",
1920
"@docusaurus/preset-classic": "3.9.1",
2021
"@mdx-js/react": "^3.0.0",
2122
"clsx": "^2.0.0",

website/yarn.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,21 @@
16431643
react-helmet-async "npm:@slorber/react-helmet-async@1.3.0"
16441644
react-loadable "npm:@docusaurus/react-loadable@6.0.0"
16451645

1646+
"@docusaurus/plugin-client-redirects@^3.9.1":
1647+
version "3.9.1"
1648+
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.9.1.tgz#06e07487f1596c62536d50afac81535d5fe60a20"
1649+
integrity sha512-+1InCGvAnw46H+TnVqxaYlJC0qy9AY5gTMgTx2ZFryjAsImJNs3i1pEYW/iUTVbOdtWRj3E/87E4ehbBIaA1TA==
1650+
dependencies:
1651+
"@docusaurus/core" "3.9.1"
1652+
"@docusaurus/logger" "3.9.1"
1653+
"@docusaurus/utils" "3.9.1"
1654+
"@docusaurus/utils-common" "3.9.1"
1655+
"@docusaurus/utils-validation" "3.9.1"
1656+
eta "^2.2.0"
1657+
fs-extra "^11.1.1"
1658+
lodash "^4.17.21"
1659+
tslib "^2.6.0"
1660+
16461661
"@docusaurus/plugin-content-blog@3.9.1":
16471662
version "3.9.1"
16481663
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.9.1.tgz#bf6619847065360d52abc5bf1da307f5ce2a19f8"

0 commit comments

Comments
 (0)