mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-21 18:27:41 +00:00
Add Chinese support (#13)
# Main changes and Some notices - Chines Docs should be put into corresponding versions' folders under `i18n/zh-cn/docusaurus-plugin-content-docs`. See [translate-markdown-files](https://docusaurus.io/docs/i18n/tutorial#translate-markdown-files) for reference. And also [srs-docs](https://github.com/ossrs/srs-docs) is a project that can be used as a reference. So changed the related paths in `loop_docs*` scripts. - The markdown files under `docs/<version>` and `i18n/zh-cn/docusaurus-plugin-content-docs/<version>` must have the same name to be referred as translated. Files inside docs are corresponding to `current` version. For example, `docs/administration/mail-templates.md` and `i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/mail-templates.md`. Filename of `mail-templates.md` must be the same (cannot be `mail-templates.zh-cn.md` and `mail-templates.us-en.md`) So trim the `.en-us.md` and `.zh-cn.md` to `.md` to ensure the same names inside `loop_docs*` scripts. - Used `npx docusaurus write-translations --locale zh-cn` to do sidebar, footer, and header translations, so no need to keep `sideBarCN` anymore. [reference](https://docusaurus.io/docs/cli#docusaurus-write-translations-sitedir) - Local Tests for `en` and `zh-cn` are separeted, run the following on local respectly to test them ```bash # test en version npm run start # test zh-cn version npm run start -- --locale zh-cn ``` - If wants to test `en` and `zh-cn` both at the same time, run build and serve ``` npm run build npm run serve ``` - Added some indexed page, for example:   Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/13 Co-authored-by: HesterG <hestergong@gmail.com> Co-committed-by: HesterG <hestergong@gmail.com>
This commit is contained in:
@@ -21,11 +21,11 @@ jobs:
|
|||||||
- name: prepare nightly docs
|
- name: prepare nightly docs
|
||||||
run: |
|
run: |
|
||||||
make prepare-latest
|
make prepare-latest
|
||||||
#prepare-latest-zh-cn
|
make prepare-latest-zh-cn
|
||||||
- name: prepare 1.19 docs
|
- name: prepare 1.19 docs
|
||||||
run: |
|
run: |
|
||||||
make prepare\#19
|
make prepare\#19
|
||||||
#prepare-zh-cn\#19
|
make prepare-zh-cn\#19
|
||||||
- name: cleanup before build
|
- name: cleanup before build
|
||||||
run: |
|
run: |
|
||||||
rm static/_*
|
rm static/_*
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,3 +26,5 @@ static/_headers
|
|||||||
static/_redirects
|
static/_redirects
|
||||||
static/latest-swagger.json
|
static/latest-swagger.json
|
||||||
static/19-swagger.json
|
static/19-swagger.json
|
||||||
|
i18n/zh-cn/docusaurus-plugin-content-docs/current
|
||||||
|
i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19
|
||||||
|
|||||||
25
Makefile
25
Makefile
@@ -27,12 +27,13 @@ prepare-latest: clone_main
|
|||||||
bash loop_docs.sh
|
bash loop_docs.sh
|
||||||
|
|
||||||
.PHONY: prepare-latest-zh-cn
|
.PHONY: prepare-latest-zh-cn
|
||||||
prepare-latest-zh-cn: clone_main
|
prepare-latest-zh-cn:
|
||||||
cp -r .tmp/upstream-docs-latest/docs/static/* static/
|
# clone_main
|
||||||
rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs-latest/docs/content/doc/ docs/zh-cn/
|
# cp -r .tmp/upstream-docs-latest/docs/static/* static/
|
||||||
cp .tmp/upstream-docs-latest/docs/content/page/index.zh-cn.md docs/zh-cn/intro.md
|
mkdir -p i18n/zh-cn/docusaurus-plugin-content-docs/current
|
||||||
|
rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs-latest/docs/content/doc/ i18n/zh-cn/docusaurus-plugin-content-docs/current/
|
||||||
|
cp .tmp/upstream-docs-latest/docs/content/page/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
|
||||||
bash loop_docs-zh-cn.sh
|
bash loop_docs-zh-cn.sh
|
||||||
rm docs/zh-cn/help/search.zh-cn.md || true
|
|
||||||
|
|
||||||
.PHONY: clone_\#%
|
.PHONY: clone_\#%
|
||||||
clone_\#%: create_dir
|
clone_\#%: create_dir
|
||||||
@@ -48,15 +49,17 @@ prepare\#%: clone_\#%
|
|||||||
cp .tmp/upstream-docs-$*/docs/content/page/index.en-us.md versioned_docs/version-1.$*/intro.md
|
cp .tmp/upstream-docs-$*/docs/content/page/index.en-us.md versioned_docs/version-1.$*/intro.md
|
||||||
cp .tmp/upstream-docs-$*/templates/swagger/v1_json.tmpl static/$*-swagger.json
|
cp .tmp/upstream-docs-$*/templates/swagger/v1_json.tmpl static/$*-swagger.json
|
||||||
bash loop_docs-$*.sh
|
bash loop_docs-$*.sh
|
||||||
rm versioned_docs/version-1.$*/help/search.en-us.md || true
|
rm versioned_docs/version-1.$*/help/search.md || true
|
||||||
|
|
||||||
.PHONY: prepare-zh-cn\#%
|
.PHONY: prepare-zh-cn\#%
|
||||||
prepare-zh-cn\#%: clone_\#%
|
prepare-zh-cn\#%:
|
||||||
cp -r .tmp/upstream-docs-$*/docs/static/* static/
|
# clone_\#%
|
||||||
rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs-$*/docs/content/doc/ versioned_docs/version-1.$*/zh-cn/
|
# cp -r .tmp/upstream-docs-$*/docs/static/* static/
|
||||||
cp .tmp/upstream-docs-19/docs/content/page/index.zh-cn.md versioned_docs/version-1.$*/zh-cn/intro.md
|
mkdir -p i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*
|
||||||
|
rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs-$*/docs/content/doc/ i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/
|
||||||
|
cp .tmp/upstream-docs-19/docs/content/page/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
|
||||||
bash loop_docs-$*-zh-cn.sh
|
bash loop_docs-$*-zh-cn.sh
|
||||||
rm versioned_docs/version-1.$*/zh-cn/help/search.zh-cn.md || true
|
rm i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/help/search.md || true
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -13,3 +13,28 @@ make build
|
|||||||
make clean
|
make clean
|
||||||
make serve
|
make serve
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Test en version
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
## Test zh-cn version
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run start -- --locale zh-cn
|
||||||
|
```
|
||||||
|
|
||||||
|
## Translate presets for zh-cn version
|
||||||
|
|
||||||
|
```
|
||||||
|
npx docusaurus write-translations --locale zh-cn
|
||||||
|
```
|
||||||
|
|
||||||
|
## Test both zh-cn and en versions
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|||||||
@@ -25,7 +25,16 @@ const config = {
|
|||||||
|
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
locales: ['en'/*, 'zh-cn', 'fr-fr', 'zh-tw'*/], // temporarily disable other locales
|
locales: ['en', 'zh-cn'/*, 'fr-fr', 'zh-tw'*/], // temporarily disable other locales
|
||||||
|
localeConfigs: {
|
||||||
|
'en': {
|
||||||
|
label: 'English',
|
||||||
|
htmlLang: 'en-US',
|
||||||
|
},
|
||||||
|
'zh-cn': {
|
||||||
|
label: '中文',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
presets: [
|
presets: [
|
||||||
@@ -71,7 +80,7 @@ const config = {
|
|||||||
"@easyops-cn/docusaurus-search-local",
|
"@easyops-cn/docusaurus-search-local",
|
||||||
{
|
{
|
||||||
hashed: false,
|
hashed: false,
|
||||||
language: ["en"],
|
language: ["en", "zh"],
|
||||||
highlightSearchTermsOnTargetPage: true,
|
highlightSearchTermsOnTargetPage: true,
|
||||||
explicitSearchResultPath: true,
|
explicitSearchResultPath: true,
|
||||||
indexBlog: false,
|
indexBlog: false,
|
||||||
@@ -113,10 +122,10 @@ const config = {
|
|||||||
type: 'search',
|
type: 'search',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
},
|
},
|
||||||
/* {
|
{
|
||||||
type: 'localeDropdown',
|
type: 'localeDropdown',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
},*/
|
},
|
||||||
{
|
{
|
||||||
type: 'docsVersionDropdown',
|
type: 'docsVersionDropdown',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
|
|||||||
29
i18n/zh-cn/docusaurus-plugin-content-docs/current.json
Normal file
29
i18n/zh-cn/docusaurus-plugin-content-docs/current.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"sidebar.docs.category.Installation": {
|
||||||
|
"message": "安装"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Administration": {
|
||||||
|
"message": "管理"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Usage": {
|
||||||
|
"message": "使用"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.actions": {
|
||||||
|
"message": "Actions"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.packages": {
|
||||||
|
"message": "软件包"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Development": {
|
||||||
|
"message": "开发"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Contributing": {
|
||||||
|
"message": "贡献"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Help": {
|
||||||
|
"message": "帮助"
|
||||||
|
},
|
||||||
|
"sidebar.docs.doc.What is Gitea?": {
|
||||||
|
"message": "Gitea是什么?"
|
||||||
|
}
|
||||||
|
}
|
||||||
26
i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19.json
Normal file
26
i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"sidebar.docs.category.Installation": {
|
||||||
|
"message": "安装"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Administration": {
|
||||||
|
"message": "管理"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Usage": {
|
||||||
|
"message": "使用"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Packages": {
|
||||||
|
"message": "软件包"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Development": {
|
||||||
|
"message": "开发"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Contributing": {
|
||||||
|
"message": "贡献"
|
||||||
|
},
|
||||||
|
"sidebar.docs.category.Help": {
|
||||||
|
"message": "帮助"
|
||||||
|
},
|
||||||
|
"sidebar.docs.doc.What is Gitea?": {
|
||||||
|
"message": "Gitea是什么?"
|
||||||
|
}
|
||||||
|
}
|
||||||
34
i18n/zh-cn/docusaurus-theme-classic/footer.json
Normal file
34
i18n/zh-cn/docusaurus-theme-classic/footer.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"link.title.Docs": {
|
||||||
|
"message": "文档",
|
||||||
|
"description": "The title of the footer links column with title=Docs in the footer"
|
||||||
|
},
|
||||||
|
"link.title.Community": {
|
||||||
|
"message": "社区",
|
||||||
|
"description": "The title of the footer links column with title=Community in the footer"
|
||||||
|
},
|
||||||
|
"link.title.More": {
|
||||||
|
"message": "更多",
|
||||||
|
"description": "The title of the footer links column with title=More in the footer"
|
||||||
|
},
|
||||||
|
"link.item.label.Tutorial": {
|
||||||
|
"message": "教程",
|
||||||
|
"description": "The label of footer link with label=Tutorial linking to /"
|
||||||
|
},
|
||||||
|
"link.item.label.Code": {
|
||||||
|
"message": "开源代码",
|
||||||
|
"description": "The label of footer link with label=Code linking to https://github.com/go-gitea/gitea"
|
||||||
|
},
|
||||||
|
"link.item.label.Stack Overflow": {
|
||||||
|
"message": "Stack Overflow",
|
||||||
|
"description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/gitea"
|
||||||
|
},
|
||||||
|
"link.item.label.Discord": {
|
||||||
|
"message": "Discord",
|
||||||
|
"description": "The label of footer link with label=Discord linking to https://discord.gg/gitea"
|
||||||
|
},
|
||||||
|
"link.item.label.Twitter": {
|
||||||
|
"message": "Twitter",
|
||||||
|
"description": "The label of footer link with label=Twitter linking to https://twitter.com/giteaio"
|
||||||
|
}
|
||||||
|
}
|
||||||
14
i18n/zh-cn/docusaurus-theme-classic/navbar.json
Normal file
14
i18n/zh-cn/docusaurus-theme-classic/navbar.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"title": {
|
||||||
|
"message": "Gitea"
|
||||||
|
},
|
||||||
|
"item.label.Docs": {
|
||||||
|
"message": "开源文档"
|
||||||
|
},
|
||||||
|
"item.label.Code": {
|
||||||
|
"message": "代码"
|
||||||
|
},
|
||||||
|
"item.label.Support": {
|
||||||
|
"message": "支持"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,43 +8,46 @@ else
|
|||||||
SED_INPLACE="sed -i ''"
|
SED_INPLACE="sed -i ''"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$SED_INPLACE 's/</<⁠/' versioned_docs/version-1.19/zh-cn/installation/with-docker.zh-cn.md
|
$SED_INPLACE 's/</<⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/installation/with-docker.zh-cn.md
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' versioned_docs/version-1.19/zh-cn/installation/with-docker.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/installation/with-docker.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/</<⁠/' versioned_docs/version-1.19/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/</<⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/contributing/guidelines-backend.zh-cn.md
|
||||||
$SED_INPLACE 's/</⁠/' versioned_docs/version-1.19/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/</⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/contributing/guidelines-backend.zh-cn.md
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' versioned_docs/version-1.19/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/contributing/guidelines-backend.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' versioned_docs/version-1.19/zh-cn/administration/config-cheat-sheet.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/administration/config-cheat-sheet.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/^url:.*//' versioned_docs/version-1.19/zh-cn/intro.md
|
$SED_INPLACE 's/^url:.*//' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/intro.md
|
||||||
$SED_INPLACE 's/^title:.*/displayed_sidebar: siderBarCN/' versioned_docs/version-1.19/zh-cn/intro.md
|
$SED_INPLACE 's/^slug:.*/slug: \//' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/intro.md
|
||||||
$SED_INPLACE 's/^slug:.*/slug: \/zh-cn\//' versioned_docs/version-1.19/zh-cn/intro.md
|
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/development/hacking-on-gitea.zh-cn.md
|
||||||
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' versioned_docs/version-1.19/zh-cn/development/hacking-on-gitea.zh-cn.md
|
|
||||||
|
|
||||||
$SED_INPLACE 's/"version":.*/"version":"1.19.0"/' static/19-swagger.json
|
$SED_INPLACE 's/"version":.*/"version":"1.19.0"/' static/19-swagger.json
|
||||||
|
|
||||||
for file in `find ./versioned_docs/version-1.19/zh-cn/ -name "*.md"`; do
|
for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/ -name "*.md"`; do
|
||||||
# note only works on linux, forget about it when attempting to run on macos
|
# note only works on linux, forget about it when attempting to run on macos
|
||||||
# hide hugo toc
|
# hide hugo toc
|
||||||
$SED_INPLACE 's/{{< toc >}}//' $file
|
$SED_INPLACE 's/{{< toc >}}//' $file
|
||||||
$SED_INPLACE 's/{{< version >}}/1.19.0/g' $file
|
$SED_INPLACE 's/{{< version >}}/1.19.0/g' $file
|
||||||
$SED_INPLACE 's/{{< relref "doc/\/docs\/zh-cn/g' $file
|
$SED_INPLACE 's/{{< relref "doc/i18n\/zh-cn\/docusaurus-plugin-content-docs\/version-1.19/g' $file
|
||||||
$SED_INPLACE 's/" >}}//g' $file
|
$SED_INPLACE 's/" >}}//g' $file
|
||||||
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
||||||
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in versioned_docs/version-1.19/zh-cn/*; do
|
for file in i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/*; do
|
||||||
if [ -d $file ]; then
|
if [ -d $file ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "$file" == "versioned_docs/version-1.19/zh-cn/intro.md" ]; then
|
if [ "$file" == "i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/intro.md" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
rm $file
|
rm $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19/ -name "*.zh-cn.md"`; do
|
||||||
|
mv "${file}" "${file/.zh-cn/}"
|
||||||
|
done
|
||||||
|
|
||||||
# for file in `find ./version ed_docs/version-1.19/zh-cn/ -name "*.md"`; do
|
# for file in `find ./version ed_docs/version-1.19/zh-cn/ -name "*.md"`; do
|
||||||
# trimmed=$(echo $file | cut -f 2 -d '.')
|
# trimmed=$(echo $file | cut -f 2 -d '.')
|
||||||
# mv $file .$trimmed.md
|
# mv $file .$trimmed.md
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ fi
|
|||||||
|
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' versioned_docs/version-1.19/administration/config-cheat-sheet.en-us.md
|
$SED_INPLACE 's/<empty/<⁠empty/' versioned_docs/version-1.19/administration/config-cheat-sheet.en-us.md
|
||||||
$SED_INPLACE 's/^url:.*//' versioned_docs/version-1.19/intro.md
|
$SED_INPLACE 's/^url:.*//' versioned_docs/version-1.19/intro.md
|
||||||
$SED_INPLACE 's/^title:.*/displayed_sidebar: defaultSidebar/' versioned_docs/version-1.19/intro.md
|
|
||||||
$SED_INPLACE 's/^slug:.*/slug: \//' versioned_docs/version-1.19/intro.md
|
$SED_INPLACE 's/^slug:.*/slug: \//' versioned_docs/version-1.19/intro.md
|
||||||
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' versioned_docs/version-1.19/development/hacking-on-gitea.en-us.md
|
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' versioned_docs/version-1.19/development/hacking-on-gitea.en-us.md
|
||||||
|
|
||||||
@@ -20,7 +19,7 @@ for file in `find ./versioned_docs/version-1.19/ -name "*.md"`; do
|
|||||||
# hide hugo toc
|
# hide hugo toc
|
||||||
$SED_INPLACE 's/{{< toc >}}//' $file
|
$SED_INPLACE 's/{{< toc >}}//' $file
|
||||||
$SED_INPLACE 's/{{< version >}}/1.19.3/g' $file
|
$SED_INPLACE 's/{{< version >}}/1.19.3/g' $file
|
||||||
$SED_INPLACE 's/{{< relref "doc/\/docs/g' $file
|
$SED_INPLACE 's/{{< relref "doc/versioned_docs\/version-1.19/g' $file
|
||||||
$SED_INPLACE 's/" >}}//g' $file
|
$SED_INPLACE 's/" >}}//g' $file
|
||||||
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
||||||
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
||||||
@@ -38,3 +37,7 @@ for file in versioned_docs/version-1.19/*; do
|
|||||||
fi
|
fi
|
||||||
rm $file
|
rm $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for file in `find ./versioned_docs/version-1.19/ -name "*.en-us.md"`; do
|
||||||
|
mv "${file}" "${file/.en-us/}"
|
||||||
|
done
|
||||||
|
|||||||
@@ -8,45 +8,47 @@ else
|
|||||||
SED_INPLACE="sed -i ''"
|
SED_INPLACE="sed -i ''"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$SED_INPLACE 's/</<⁠/' docs/zh-cn/installation/with-docker.zh-cn.md
|
$SED_INPLACE 's/</<⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/current/installation/with-docker.zh-cn.md
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' docs/zh-cn/installation/with-docker.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/current/installation/with-docker.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/</<⁠/' docs/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/</<⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/current/contributing/guidelines-backend.zh-cn.md
|
||||||
$SED_INPLACE 's/</⁠/' docs/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/</⁠/' i18n/zh-cn/docusaurus-plugin-content-docs/current/contributing/guidelines-backend.zh-cn.md
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' docs/zh-cn/contributing/guidelines-backend.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/current/contributing/guidelines-backend.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/<empty/<⁠empty/' docs/zh-cn/administration/config-cheat-sheet.zh-cn.md
|
$SED_INPLACE 's/<empty/<⁠empty/' i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/config-cheat-sheet.zh-cn.md
|
||||||
|
|
||||||
$SED_INPLACE 's/^url:.*//' docs/zh-cn/intro.md
|
$SED_INPLACE 's/^url:.*//' i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
|
||||||
$SED_INPLACE 's/^title:.*/displayed_sidebar: siderBarCN/' docs/zh-cn/intro.md
|
$SED_INPLACE 's/^slug:.*/slug: \//' i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
|
||||||
$SED_INPLACE 's/^slug:.*/slug: \/zh-cn\//' docs/zh-cn/intro.md
|
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' i18n/zh-cn/docusaurus-plugin-content-docs/current/development/hacking-on-gitea.zh-cn.md
|
||||||
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' docs/zh-cn/development/hacking-on-gitea.zh-cn.md
|
|
||||||
|
|
||||||
$SED_INPLACE 's/"version":.*/"version":"1.20-dev"/' static/latest-swagger.json
|
$SED_INPLACE 's/"version":.*/"version":"1.20-dev"/' static/latest-swagger.json
|
||||||
|
|
||||||
for file in `find ./docs/zh-cn/ -name "*.md"`; do
|
for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/current/ -name "*.md"`; do
|
||||||
# note only works on linux, forget about it when attempting to run on macos
|
# note only works on linux, forget about it when attempting to run on macos
|
||||||
# hide hugo toc
|
# hide hugo toc
|
||||||
$SED_INPLACE 's/{{< toc >}}//' $file
|
$SED_INPLACE 's/{{< toc >}}//' $file
|
||||||
$SED_INPLACE 's/{{< version >}}/1.18.2/g' $file
|
$SED_INPLACE 's/{{< version >}}/1.18.2/g' $file
|
||||||
$SED_INPLACE 's/{{< relref "doc/\/docs\/zh-cn/g' $file
|
$SED_INPLACE 's/{{< relref "doc/i18n\/zh-cn\/docusaurus-plugin-content-docs\/current/g' $file
|
||||||
$SED_INPLACE 's/" >}}//g' $file
|
$SED_INPLACE 's/" >}}//g' $file
|
||||||
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
||||||
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in docs/zh-cn/*; do
|
for file in i18n/zh-cn/docusaurus-plugin-content-docs/current/*; do
|
||||||
if [ -d $file ]; then
|
if [ -d $file ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "$file" == "docs/zh-cn/intro.md" ]; then
|
if [ "$file" == "i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
rm $file
|
rm $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/current/ -name "*.zh-cn.md"`; do
|
||||||
|
mv "${file}" "${file/.zh-cn/}"
|
||||||
|
done
|
||||||
|
|
||||||
# for file in `find ./docs/zh-cn/ -name "*.md"`; do
|
# for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/current/ -name "*.md"`; do
|
||||||
# trimmed=$(echo $file | cut -f 2 -d '.')
|
# trimmed=$(echo $file | cut -f 2 -d '.')
|
||||||
# mv $file .$trimmed.md
|
# mv $file .$trimmed.md
|
||||||
# done
|
# done
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ $SED_INPLACE 's/<empty/<⁠empty/' docs/contributing/guidelines-backend.en-u
|
|||||||
$SED_INPLACE 's/</<⁠/' docs/contributing/guidelines-backend.en-us.md
|
$SED_INPLACE 's/</<⁠/' docs/contributing/guidelines-backend.en-us.md
|
||||||
$SED_INPLACE 's/</⁠/' docs/contributing/guidelines-backend.en-us.md
|
$SED_INPLACE 's/</⁠/' docs/contributing/guidelines-backend.en-us.md
|
||||||
$SED_INPLACE 's/^url:.*//' docs/intro.md
|
$SED_INPLACE 's/^url:.*//' docs/intro.md
|
||||||
$SED_INPLACE 's/^title:.*/displayed_sidebar: defaultSidebar/' docs/intro.md
|
|
||||||
$SED_INPLACE 's/^slug:.*/slug: \//' docs/intro.md
|
$SED_INPLACE 's/^slug:.*/slug: \//' docs/intro.md
|
||||||
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' docs/development/hacking-on-gitea.en-us.md
|
$SED_INPLACE 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' docs/development/hacking-on-gitea.en-us.md
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ for file in `find ./docs/ -name "*.md"`; do
|
|||||||
# hide hugo toc
|
# hide hugo toc
|
||||||
$SED_INPLACE 's/{{< toc >}}//' $file
|
$SED_INPLACE 's/{{< toc >}}//' $file
|
||||||
$SED_INPLACE 's/{{< version >}}/main-nightly/g' $file
|
$SED_INPLACE 's/{{< version >}}/main-nightly/g' $file
|
||||||
$SED_INPLACE 's/{{< relref "doc/\/docs/g' $file
|
$SED_INPLACE 's/{{< relref "doc/i18n\/en\/docusaurus-plugin-content-docs\/current/g' $file
|
||||||
$SED_INPLACE 's/" >}}//g' $file
|
$SED_INPLACE 's/" >}}//g' $file
|
||||||
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
|
||||||
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
|
||||||
@@ -39,3 +38,7 @@ for file in docs/*; do
|
|||||||
fi
|
fi
|
||||||
rm $file || true
|
rm $file || true
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for file in `find ./docs/ -name "*.en-us.md"`; do
|
||||||
|
mv "${file}" "${file/.en-us/}"
|
||||||
|
done
|
||||||
|
|||||||
101
sidebars.js
101
sidebars.js
@@ -1,13 +1,16 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
defaultSidebar: [
|
docs: [
|
||||||
{
|
{
|
||||||
type: 'link',
|
type: 'doc',
|
||||||
|
id: 'intro',
|
||||||
label: 'What is Gitea?',
|
label: 'What is Gitea?',
|
||||||
href: '/next/'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Installation',
|
label: 'Installation',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -18,6 +21,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Administration',
|
label: 'Administration',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -28,6 +34,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Usage',
|
label: 'Usage',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -38,6 +47,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Development',
|
label: 'Development',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -48,6 +60,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Contributing',
|
label: 'Contributing',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -58,6 +73,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
label: 'Help',
|
label: 'Help',
|
||||||
|
link: {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
type: 'autogenerated',
|
type: 'autogenerated',
|
||||||
@@ -65,82 +83,5 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]/*,
|
|
||||||
siderBarCN: [
|
|
||||||
{
|
|
||||||
type: 'link',
|
|
||||||
label: 'Gitea是什么?',
|
|
||||||
href: 'zh-cn/next/'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '安装',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/installation',
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '管理',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/administration',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '使用',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '软件包管理',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/usage/packages',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/usage',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '开发',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/development',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '贡献',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/contributing',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: '帮助',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: 'zh-cn/help',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
],*/
|
|
||||||
};
|
};
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
{
|
{
|
||||||
"defaultSidebar": [
|
"docs": [
|
||||||
{
|
{
|
||||||
"type": "link",
|
"type": "doc",
|
||||||
"label": "What is Gitea?",
|
"id": "intro",
|
||||||
"href": "/"
|
"label": "What is Gitea?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Installation",
|
"label": "Installation",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "autogenerated",
|
"type": "autogenerated",
|
||||||
@@ -18,6 +21,9 @@
|
|||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Administration",
|
"label": "Administration",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "autogenerated",
|
"type": "autogenerated",
|
||||||
@@ -28,6 +34,9 @@
|
|||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Usage",
|
"label": "Usage",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
@@ -48,6 +57,9 @@
|
|||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Development",
|
"label": "Development",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "autogenerated",
|
"type": "autogenerated",
|
||||||
@@ -58,6 +70,9 @@
|
|||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Contributing",
|
"label": "Contributing",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "autogenerated",
|
"type": "autogenerated",
|
||||||
@@ -68,6 +83,9 @@
|
|||||||
{
|
{
|
||||||
"type": "category",
|
"type": "category",
|
||||||
"label": "Help",
|
"label": "Help",
|
||||||
|
"link": {
|
||||||
|
"type": "generated-index"
|
||||||
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "autogenerated",
|
"type": "autogenerated",
|
||||||
|
|||||||
Reference in New Issue
Block a user