mirror of
https://gitea.com/gitea/docs.git
synced 2026-06-23 04:35:56 +00:00
Should resolve #21
I cannot seem to get this to run properly on my machine, however this is an educated guess because the Chinese translation looks correct.
zh-cn
https://docs.gitea.com/zh-cn/administration/config-cheat-sheet#repository---release-repositoryrelease
8c38ae516a/loop_docs-zh-cn.sh (L11)
en-us
https://docs.gitea.com/administration/config-cheat-sheet#repository---release-repositoryrelease
(check diff for current incantation)
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/22
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
43 lines
1.2 KiB
Bash
43 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
set -xe
|
|
|
|
if sed --version 2>/dev/null | grep -q GNU; then
|
|
SED_INPLACE="sed -i"
|
|
else
|
|
SED_INPLACE="sed -i ''"
|
|
fi
|
|
|
|
$SED_INPLACE 's/\\<empty>/<empty\\>/' docs/administration/config-cheat-sheet.en-us.md
|
|
$SED_INPLACE 's/^url:.*//' 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/"version":.*/"version":"1.20-dev"/' static/latest-swagger.json
|
|
|
|
for file in `find ./docs/ -name "*.md"`; do
|
|
# hide hugo toc
|
|
$SED_INPLACE 's/{{< toc >}}//' $file
|
|
$SED_INPLACE 's/{{< version >}}/main-nightly/g' $file
|
|
$SED_INPLACE 's/{{< relref "doc\///g' $file
|
|
$SED_INPLACE 's/.en-us.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
|
|
done
|
|
|
|
for file in docs/*; do
|
|
if [ -d $file ]; then
|
|
continue
|
|
fi
|
|
if [ "$file" == "docs/intro.md" ]; then
|
|
continue
|
|
fi
|
|
rm $file || true
|
|
done
|
|
|
|
for file in `find ./docs/ -name "*.en-us.md"`; do
|
|
mv "${file}" "${file/.en-us/}"
|
|
done
|