From 089f2a0b46212c4c69cbcde5aaadb05c3bb43420 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 6 Jun 2024 17:10:46 +0800 Subject: [PATCH] Make the index page default --- .gitignore | 2 -- Makefile | 4 ---- docusaurus.config.js | 6 +----- sidebars.js | 4 ++-- versioned_sidebars/version-1.19-sidebars.json | 2 +- versioned_sidebars/version-1.20-sidebars.json | 4 ++-- versioned_sidebars/version-1.21-sidebars.json | 4 ++-- versioned_sidebars/version-1.22-sidebars.json | 2 +- 8 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 26ca3b40..1283408f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index 1fb42f58..bd2fefc2 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docusaurus.config.js b/docusaurus.config.js index b03d9947..41de18f0 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -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', }, diff --git a/sidebars.js b/sidebars.js index 66dd1be2..2db2f282 100644 --- a/sidebars.js +++ b/sidebars.js @@ -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 = { ] }, ] -}; \ No newline at end of file +}; diff --git a/versioned_sidebars/version-1.19-sidebars.json b/versioned_sidebars/version-1.19-sidebars.json index 3af8e970..db3040f4 100644 --- a/versioned_sidebars/version-1.19-sidebars.json +++ b/versioned_sidebars/version-1.19-sidebars.json @@ -2,7 +2,7 @@ "docs": [ { "type": "doc", - "id": "intro", + "id": "index.en-us", "label": "What is Gitea?" }, { diff --git a/versioned_sidebars/version-1.20-sidebars.json b/versioned_sidebars/version-1.20-sidebars.json index d56dfea5..a1cddccd 100644 --- a/versioned_sidebars/version-1.20-sidebars.json +++ b/versioned_sidebars/version-1.20-sidebars.json @@ -2,7 +2,7 @@ "docs": [ { "type": "doc", - "id": "intro", + "id": "index.en-us", "label": "What is Gitea?" }, { @@ -84,4 +84,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/versioned_sidebars/version-1.21-sidebars.json b/versioned_sidebars/version-1.21-sidebars.json index d56dfea5..a1cddccd 100644 --- a/versioned_sidebars/version-1.21-sidebars.json +++ b/versioned_sidebars/version-1.21-sidebars.json @@ -2,7 +2,7 @@ "docs": [ { "type": "doc", - "id": "intro", + "id": "index.en-us", "label": "What is Gitea?" }, { @@ -84,4 +84,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/versioned_sidebars/version-1.22-sidebars.json b/versioned_sidebars/version-1.22-sidebars.json index 70c09b53..a1cddccd 100644 --- a/versioned_sidebars/version-1.22-sidebars.json +++ b/versioned_sidebars/version-1.22-sidebars.json @@ -2,7 +2,7 @@ "docs": [ { "type": "doc", - "id": "intro", + "id": "index.en-us", "label": "What is Gitea?" }, {