Make the index page default

This commit is contained in:
Lunny Xiao
2024-06-06 17:10:46 +08:00
parent 7c1ce71ffc
commit 089f2a0b46
8 changed files with 9 additions and 19 deletions

2
.gitignore vendored
View File

@ -20,8 +20,6 @@ yarn-debug.log*
yarn-error.log*
.tmp/
docs/
versioned_docs/
# Static files other than those explicitly tracked
/static
i18n/zh-cn/docusaurus-plugin-content-docs/current

View File

@ -44,7 +44,6 @@ clone_main: clone
prepare-latest: clone_main
cp -r .tmp/upstream-docs/docs/static/* static/
rsync -avz --prune-empty-dirs --include '*/' --include='*.en-us.md' --exclude '*' .tmp/upstream-docs/docs/content/ docs/
cp .tmp/upstream-docs/docs/content/index.en-us.md docs/intro.md
cp .tmp/upstream-docs/templates/swagger/v1_json.tmpl static/swagger-latest.json
bash loop_docs.sh latest en-us
@ -52,7 +51,6 @@ prepare-latest: clone_main
prepare-latest-zh-cn:
mkdir -p i18n/zh-cn/docusaurus-plugin-content-docs/current
rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs/docs/content/ i18n/zh-cn/docusaurus-plugin-content-docs/current/
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md
bash loop_docs.sh latest zh-cn
.PHONY: clone_\#%
@ -69,7 +67,6 @@ clone_\#%: clone
prepare\#%: clone_\#%
cp -r .tmp/upstream-docs/docs/static/* static/
rsync -a --prune-empty-dirs --include '*/' --include='*.en-us.md' --exclude '*' .tmp/upstream-docs/docs/content/ versioned_docs/version-1.$*/
cp .tmp/upstream-docs/docs/content/index.en-us.md versioned_docs/version-1.$*/intro.md
cp .tmp/upstream-docs/templates/swagger/v1_json.tmpl static/swagger-$*.json
bash loop_docs.sh $* en-us
@ -77,7 +74,6 @@ prepare\#%: clone_\#%
prepare-zh-cn\#%:
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/ i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/
cp .tmp/upstream-docs/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md
bash loop_docs.sh $* zh-cn
.PHONY: install

View File

@ -108,10 +108,6 @@ const config = {
return `https://gitea.com/gitea/awesome-gitea/src/branch/main/README.md`
}
let fileName = `${docPath.replace('.md', '')}.${locale}.md`;
// intro.md has different name from upstream, need to handle this here
if (docPath.includes('intro.md')) {
fileName = `page/index.${locale}.md`;
}
return `https://github.com/go-gitea/gitea/tree/${version === 'current' ? 'main': `release/v${version}`}/docs/content/${fileName}`;
},
versions: {
@ -193,7 +189,7 @@ const config = {
items: [
{
type: 'doc',
docId: 'intro',
docId: 'index.en-us',
position: 'left',
label: 'Docs',
},

View File

@ -2,7 +2,7 @@ module.exports = {
docs: [
{
type: 'doc',
id: 'intro',
id: 'index.en-us',
label: 'What is Gitea?',
},
{
@ -84,4 +84,4 @@ module.exports = {
]
},
]
};
};

View File

@ -2,7 +2,7 @@
"docs": [
{
"type": "doc",
"id": "intro",
"id": "index.en-us",
"label": "What is Gitea?"
},
{

View File

@ -2,7 +2,7 @@
"docs": [
{
"type": "doc",
"id": "intro",
"id": "index.en-us",
"label": "What is Gitea?"
},
{
@ -84,4 +84,4 @@
]
}
]
}
}

View File

@ -2,7 +2,7 @@
"docs": [
{
"type": "doc",
"id": "intro",
"id": "index.en-us",
"label": "What is Gitea?"
},
{
@ -84,4 +84,4 @@
]
}
]
}
}

View File

@ -2,7 +2,7 @@
"docs": [
{
"type": "doc",
"id": "intro",
"id": "index.en-us",
"label": "What is Gitea?"
},
{