Files
docs/loop_docs.sh
T

47 lines
1.4 KiB
Bash
Raw Normal View History

2023-02-02 23:30:20 -05:00
#!/bin/bash
set -xe
2023-03-26 01:22:34 -04:00
if sed --version 2>/dev/null | grep -q GNU; then
SED_INPLACE="sed -i"
else
SED_INPLACE="sed -i ''"
fi
2023-02-02 23:30:20 -05:00
2023-03-26 01:22:34 -04:00
$SED_INPLACE 's/<empty/<&#8288;empty/' docs/administration/config-cheat-sheet.en-us.md
$SED_INPLACE 's/<empty/<&#8288;empty/' docs/contributing/guidelines-backend.en-us.md
$SED_INPLACE 's/</<&#8288;/' docs/contributing/guidelines-backend.en-us.md
$SED_INPLACE 's/</&#8288;/' docs/contributing/guidelines-backend.en-us.md
$SED_INPLACE 's/^url:.*//' docs/intro.md
$SED_INPLACE 's/^title:.*/displayed_sidebar: mySidebar/' 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
2023-02-02 23:30:20 -05:00
for file in `find ./docs/ -name "*.md"`; do
# hide hugo toc
2023-03-26 01:22:34 -04:00
$SED_INPLACE 's/{{< toc >}}//' $file
$SED_INPLACE 's/{{< version >}}/1.18.5/g' $file
$SED_INPLACE 's/{{< relref "doc/\/docs/g' $file
$SED_INPLACE 's/" >}}//g' $file
$SED_INPLACE 's/\*\*Table of Contents\*\*//' $file
$SED_INPLACE 's/weight:/sidebar_position:/g' $file
2023-03-26 00:57:39 -04:00
#sed -i 's/^slug:.*//' $file
2023-02-02 23:30:20 -05:00
done
for file in `find ./docs/usage/ -name "*.md"`; do
# hide hugo toc
2023-03-26 01:22:34 -04:00
$SED_INPLACE 's/title:.*//' $file
2023-02-02 23:30:20 -05:00
done
for file in docs/*; do
if [ -d $file ]; then
continue
fi
if [ "$file" == "docs/intro.md" ]; then
continue
fi
rm $file
done