diff --git a/.gitea/workflows/build-and-publish.yaml b/.gitea/workflows/build-and-publish.yaml index f450d346..0208ba41 100644 --- a/.gitea/workflows/build-and-publish.yaml +++ b/.gitea/workflows/build-and-publish.yaml @@ -33,9 +33,6 @@ jobs: - name: prepare awesome list run: | make prepare-awesome-latest prepare-awesome\#20 prepare-awesome\#19 - - name: cleanup before build - run: | - rm static/_* - name: build site run: | make build diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index feb5ac4c..70bb6623 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -29,9 +29,6 @@ jobs: - name: prepare awesome list run: | make prepare-awesome-latest prepare-awesome\#20 prepare-awesome\#19 - - name: cleanup before build - run: | - rm static/_* - name: build site run: | make build diff --git a/.gitignore b/.gitignore index 510c44c8..71da4d3d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,11 +22,8 @@ yarn-error.log* .tmp/ docs/ versioned_docs/ -static/_headers -static/_redirects -static/swagger-latest.json -static/swagger-19.json -static/swagger-20.json +# Static files other than those explicitly tracked +/static i18n/zh-cn/docusaurus-plugin-content-docs/current i18n/zh-cn/docusaurus-plugin-content-docs/version-1.19 i18n/zh-cn/docusaurus-plugin-content-docs/version-1.20 diff --git a/Makefile b/Makefile index 6d57ac40..86c54317 100644 --- a/Makefile +++ b/Makefile @@ -23,15 +23,15 @@ prepare-awesome\#%: clone_main: create_dir git clone --branch=main https://github.com/go-gitea/gitea.git .tmp/upstream-docs-latest cur_path=`pwd` - cd .tmp/upstream-docs-latest/docs && make trans-copy + cd .tmp/upstream-docs-latest/docs && bash scripts/trans-copy.sh cd $(cur_path) bash check_outdated.sh latest zh-cn .PHONY: prepare-latest prepare-latest: clone_main cp -r .tmp/upstream-docs-latest/docs/static/* static/ - rsync -avz --prune-empty-dirs --include '*/' --include='*.en-us.md' --exclude '*' .tmp/upstream-docs-latest/docs/content/doc/ docs/ - cp .tmp/upstream-docs-latest/docs/content/page/index.en-us.md docs/intro.md + rsync -avz --prune-empty-dirs --include '*/' --include='*.en-us.md' --exclude '*' .tmp/upstream-docs-latest/docs/content/ docs/ + cp .tmp/upstream-docs-latest/docs/content/index.en-us.md docs/intro.md cp .tmp/upstream-docs-latest/templates/swagger/v1_json.tmpl static/swagger-latest.json bash loop_docs.sh latest en-us @@ -40,8 +40,8 @@ prepare-latest-zh-cn: # clone_main # cp -r .tmp/upstream-docs-latest/docs/static/* static/ 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 + rsync -avz --prune-empty-dirs --include '*/' --include='*.zh-cn.md' --exclude '*' .tmp/upstream-docs-latest/docs/content/ i18n/zh-cn/docusaurus-plugin-content-docs/current/ + cp .tmp/upstream-docs-latest/docs/content/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/current/intro.md bash loop_docs.sh latest zh-cn rm -rf .tmp/upstream-docs-latest @@ -49,15 +49,15 @@ prepare-latest-zh-cn: clone_\#%: create_dir git clone --branch=release/v1.$* https://github.com/go-gitea/gitea.git .tmp/upstream-docs-$* cur_path=`pwd` - cd .tmp/upstream-docs-$*/docs && make trans-copy + cd .tmp/upstream-docs-$*/docs && bash scripts/trans-copy.sh cd $(cur_path) bash check_outdated.sh $* zh-cn .PHONY: prepare\#% 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/doc/ versioned_docs/version-1.$*/ - cp .tmp/upstream-docs-$*/docs/content/page/index.en-us.md versioned_docs/version-1.$*/intro.md + 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 @@ -66,8 +66,8 @@ prepare-zh-cn\#%: # clone_\#% # cp -r .tmp/upstream-docs-$*/docs/static/* static/ 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-$*/docs/content/page/index.zh-cn.md i18n/zh-cn/docusaurus-plugin-content-docs/version-1.$*/intro.md + 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 rm -rf .tmp/upstream-docs-$* diff --git a/check_outdated.sh b/check_outdated.sh index d4b898be..9abf658f 100755 --- a/check_outdated.sh +++ b/check_outdated.sh @@ -22,7 +22,7 @@ locale="$2" cur_path=`pwd` cd .tmp/upstream-docs-"$version" -for file in `find ./docs/content/doc -name "*.${locale}.md"`; do +for file in `find ./docs/content -name "*.${locale}.md"`; do file_en="${file/.${locale}/.en-us}" if [ ! -f "$file_en" ]; then continue diff --git a/docusaurus.config.js b/docusaurus.config.js index 1575b3df..d00dfb89 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -93,7 +93,7 @@ const config = { banner: 'unreleased', }, '1.20': { - label: '1.20.0' + label: '1.20.1' }, '1.19': { label: '1.19.4', diff --git a/loop_docs.sh b/loop_docs.sh index 68d4ec7a..6e8c62f3 100755 --- a/loop_docs.sh +++ b/loop_docs.sh @@ -27,7 +27,7 @@ if [ "$version" == "1.19" ]; then minorVer="1.19.4" minGoVer="1.19" elif [ "$version" == "1.20" ]; then - minorVer="1.20.0" + minorVer="1.20.1" fi docs_dir="versioned_docs/version-$version" @@ -43,44 +43,29 @@ else fi fi -if [ -f "$docs_dir/installation/with-docker.$locale.md" ]; then - SED_INPLACE 's/\\//' "$docs_dir/installation/with-docker.$locale.md" -fi -SED_INPLACE 's/\\//' "$docs_dir/administration/config-cheat-sheet.$locale.md" -SED_INPLACE 's/^url:.*//' "$docs_dir/intro.md" -SED_INPLACE 's/^slug:.*/slug: \//' "$docs_dir/intro.md" -SED_INPLACE "s/{{< min-node-version >}}/$minNodeVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" -SED_INPLACE "s/{{< min-go-version >}}/$minGoVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" -SED_INPLACE "s/{{< go-version >}}/$goVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" -SED_INPLACE "s/{{< min-node-version >}}/$minNodeVer/" "$docs_dir/installation/from-source.$locale.md" -SED_INPLACE "s/{{< min-go-version >}}/$minGoVer/" "$docs_dir/installation/from-source.$locale.md" +SED_INPLACE "s/@minNodeVersion@/$minNodeVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" +SED_INPLACE "s/@minGoVersion@/$minGoVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" +SED_INPLACE "s/@goVersion@/$goVer/" "$docs_dir/development/hacking-on-gitea.$locale.md" +SED_INPLACE "s/@minNodeVersion@/$minNodeVer/" "$docs_dir/installation/from-source.$locale.md" +SED_INPLACE "s/@minGoVersion@/$minGoVer/" "$docs_dir/installation/from-source.$locale.md" # TODO: improve this sed # need confirmation if [ "$version" == "latest" ]; then SED_INPLACE 's/"version": "{{AppVer | JSEscape | Safe}}"/"version": "1.21-dev"/' static/swagger-latest.json elif [ "$version" == "1.20" ]; then - SED_INPLACE 's/"version": "{{AppVer | JSEscape | Safe}}"/"version": "1.20.0-rc2"/' static/swagger-20.json + SED_INPLACE 's/"version": "{{AppVer | JSEscape | Safe}}"/"version": "1.20.1"/' static/swagger-20.json elif [ "$version" == "1.19" ]; then SED_INPLACE 's/"version": "{{AppVer | JSEscape | Safe}}"/"version": "1.19.4"/' static/swagger-19.json fi SED_INPLACE 's/"basePath": "{{AppSubUrl | JSEscape | Safe}}/"basePath": "https:\/\/gitea.com/' static/swagger-"$1".json for file in `find ./"$docs_dir" -name "*.md"`; do - # hide hugo toc - SED_INPLACE 's/{{< toc >}}//' $file if [ "$version" == "lastest" ]; then - SED_INPLACE 's/dl.gitea.com\/gitea\/{{< version >}}/dl.gitea.com\/gitea\/main/g' $file - SED_INPLACE 's/gitea\/gitea\:{{< version >}}/gitea\/gitea\:nightly/g' $file + SED_INPLACE 's/dl.gitea.com\/gitea\/@version@/dl.gitea.com\/gitea\/main/g' $file + SED_INPLACE 's/gitea\/gitea\:@version@/gitea\/gitea\:nightly/g' $file fi - SED_INPLACE "s/{{< version >}}/$version/g" $file - SED_INPLACE 's/{{< relref "doc\///g' $file - SED_INPLACE "s/.$locale.md/.md/g" $file - SED_INPLACE 's/" >}}//g' $file - SED_INPLACE 's/\*\*Table of Contents\*\*//' $file - SED_INPLACE 's/weight:/sidebar_position:/g' $file - #sed -i 's/^slug:.*//' $file + SED_INPLACE "s/@version@/$version/g" $file done for file in "$docs_dir"/*; do diff --git a/static/authorize.png b/static/authorize.png deleted file mode 100644 index 7556b122..00000000 Binary files a/static/authorize.png and /dev/null differ diff --git a/static/cloudron.svg b/static/cloudron.svg deleted file mode 100644 index 716f67a1..00000000 --- a/static/cloudron.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/static/open-in-gitpod.svg b/static/open-in-gitpod.svg deleted file mode 100644 index b97cd294..00000000 --- a/static/open-in-gitpod.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ 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 af983c3f..3af8e970 100644 --- a/versioned_sidebars/version-1.19-sidebars.json +++ b/versioned_sidebars/version-1.19-sidebars.json @@ -42,10 +42,10 @@ "type": "category", "label": "Packages", "items": [ - { + { "type": "autogenerated", "dirName": "packages" - } + } ] }, {