diff --git a/.gitea/workflows/build-and-publish.yaml b/.gitea/workflows/build-and-publish.yaml index 58d0ae92..f5015ea8 100644 --- a/.gitea/workflows/build-and-publish.yaml +++ b/.gitea/workflows/build-and-publish.yaml @@ -19,6 +19,7 @@ jobs: run: | git clone --depth=1 --branch=main https://github.com/go-gitea/gitea.git .tmp/upstream-docs-latest git clone --depth=1 --branch=release/v1.18 https://github.com/go-gitea/gitea.git .tmp/upstream-docs-18 + git clone --depth=1 --branch=release/v1.19 https://github.com/go-gitea/gitea.git .tmp/upstream-docs-19 - name: build nightly docs run: | @@ -29,7 +30,15 @@ jobs: bash loop_docs.sh rm docs/help/search.en-us.md rm -rf .tmp/upstream-docs-latest - + - name: 1.19 docs + run: | + cp -r .tmp/upstream-docs-19/docs/static/* static/ + rsync -avz --prune-empty-dirs --include '*/' --include='*.en-us.md' --exclude '*' .tmp/upstream-docs-19/docs/content/doc/ versioned_docs/version-1.19/ + cp .tmp/upstream-docs-19/docs/content/page/index.en-us.md versioned_docs/version-1.19/intro.md + cp .tmp/upstream-docs-19/templates/swagger/v1_json.tmpl static/19-swagger.json + bash loop_docs-19.sh + rm versioned_docs/version-1.19/help/search.en-us.md + rm -rf .tmp/upstream-docs-19 - name: 1.18 docs run: | cp -r .tmp/upstream-docs-18/docs/static/* static/ diff --git a/loop_docs-19.sh b/loop_docs-19.sh new file mode 100644 index 00000000..abb269e0 --- /dev/null +++ b/loop_docs-19.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -xe + +sed -i 's/}}//' $file + sed -i 's/{{< version >}}/1.18.5/g' $file + sed -i 's/{{< relref "doc/\/docs/g' $file + sed -i 's/" >}}//g' $file + sed -i 's/\*\*Table of Contents\*\*//' $file +done + +for file in `find ./versioned_docs/version-1.18/usage/ -name "*.md"`; do + # note only works on linux, forget about it when attempting to run on macos + # hide hugo toc + sed -i 's/title:.*//' $file +done + +for file in versioned_docs/version-1.18/*; do + if [ -d $file ]; then + continue + fi + if [ "$file" == "versioned_docs/version-1.18/intro.md" ]; then + continue + fi + rm $file +done + +# for file in `find ./versioned_docs/version-1.18/ -name "*.md"`; do +# trimmed=$(echo $file | cut -f 2 -d '.') +# mv $file .$trimmed.md +# done +# for file in `find ./i18n/zh-tw/docusaurus-plugin-content-docs/version-1.18/ -name "*.md"`; do +# trimmed=$(echo $file | cut -f 2 -d '.') +# mv $file .$trimmed.md +# done +# for file in `find ./i18n/fr-fr/docusaurus-plugin-content-docs/version-1.18/ -name "*.md"`; do +# trimmed=$(echo $file | cut -f 2 -d '.') +# mv $file .$trimmed.md +# done +# for file in `find ./i18n/zh-cn/docusaurus-plugin-content-docs/version-1.18/ -name "*.md"`; do +# trimmed=$(echo $file | cut -f 2 -d '.') +# mv $file .$trimmed.md +# done diff --git a/loop_docs.sh b/loop_docs.sh index cb14b48a..30599f21 100644 --- a/loop_docs.sh +++ b/loop_docs.sh @@ -10,7 +10,7 @@ sed -i 's/^title:.*/displayed_sidebar: mySidebar/' docs/intro.md sed -i 's/^slug:.*/slug: \//' docs/intro.md sed -i 's/.\/guidelines-frontend.md/.\/guidelines-frontend/' docs/developers/hacking-on-gitea.en-us.md -sed -i 's/"version":.*/"version":"1.19-dev"/' static/latest-swagger.json +sed -i 's/"version":.*/"version":"1.20-dev"/' static/latest-swagger.json for file in `find ./docs/ -name "*.md"`; do # note only works on linux, forget about it when attempting to run on macos diff --git a/versioned_sidebars/version-1.18-sidebars.json b/versioned_sidebars/version-1.18-sidebars.json index 8f5298e8..81128445 100644 --- a/versioned_sidebars/version-1.18-sidebars.json +++ b/versioned_sidebars/version-1.18-sidebars.json @@ -3,7 +3,7 @@ { "type": "link", "label": "What is Gitea?", - "href": "/" + "href": "/1.18/" }, { "type": "category", diff --git a/versioned_sidebars/version-1.19-sidebars.json b/versioned_sidebars/version-1.19-sidebars.json new file mode 100644 index 00000000..8f5298e8 --- /dev/null +++ b/versioned_sidebars/version-1.19-sidebars.json @@ -0,0 +1,99 @@ +{ + "mySidebar": [ + { + "type": "link", + "label": "What is Gitea?", + "href": "/" + }, + { + "type": "category", + "label": "Help", + "items": [ + { + "type": "autogenerated", + "dirName": "help" + } + ] + }, + { + "type": "category", + "label": "Installation", + "items": [ + { + "type": "autogenerated", + "dirName": "installation" + } + ] + }, + { + "type": "category", + "label": "Upgrade", + "items": [ + { + "type": "autogenerated", + "dirName": "upgrade" + } + ] + }, + { + "type": "category", + "label": "Features", + "items": [ + { + "type": "autogenerated", + "dirName": "features" + } + ] + }, + { + "type": "category", + "label": "Usage", + "items": [ + { + "type": "autogenerated", + "dirName": "usage" + } + ] + }, + { + "type": "category", + "label": "Advanced", + "items": [ + { + "type": "autogenerated", + "dirName": "advanced" + } + ] + }, + { + "type": "category", + "label": "Packages", + "items": [ + { + "type": "autogenerated", + "dirName": "packages" + } + ] + }, + { + "type": "category", + "label": "Translation", + "items": [ + { + "type": "autogenerated", + "dirName": "translation" + } + ] + }, + { + "type": "category", + "label": "Developers", + "items": [ + { + "type": "autogenerated", + "dirName": "developers" + } + ] + } + ] +} diff --git a/versions.json b/versions.json index 1ce858cf..0fadb2a5 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ [ + "1.19", "1.18" ]