ci: fix gitea wiki 500 errors by stripping .md from links and using static router
All checks were successful
Update Wiki Documentation / generate-docs (push) Successful in 2m12s
All checks were successful
Update Wiki Documentation / generate-docs (push) Successful in 2m12s
This commit is contained in:
@@ -51,15 +51,22 @@ jobs:
|
|||||||
|
|
||||||
cd wiki_dir
|
cd wiki_dir
|
||||||
|
|
||||||
# Gitea Wiki bezwzględnie wymaga pliku Home.md w głównym katalogu (root).
|
# Gitea Wiki źle radzi sobie z linkami zawierającymi rozszerzenie .md w URL.
|
||||||
# Spłaszczamy strukturę dla pliku startowego, jeśli trzeba.
|
# Usuwamy .md z linków wewnętrznych za pomocą Perla (pomijamy linki http/https).
|
||||||
if [ -f "shared/index.md" ]; then
|
find . -type f -name "*.md" -exec perl -pi -e 's/\]\((?!http)(.*?)\.md(?:#(.*?))?\)/\]\($1#$2\)/g' {} +
|
||||||
cp shared/index.md Home.md
|
# Sprzątanie pustych anchorów (jeśli #$2 było puste, zostaje '#' na końcu, usuwamy to)
|
||||||
elif [ -f "index.md" ]; then
|
find . -type f -name "*.md" -exec perl -pi -e 's/#\)/)/g' {} +
|
||||||
mv index.md Home.md
|
|
||||||
else
|
# Tworzymy statyczną stronę Home.md.
|
||||||
echo "# RetroHA Documentation" > Home.md
|
# Kopiowanie index.md psuło linki relatywne, więc tworzymy prosty router.
|
||||||
echo "Auto-generated by Dokka. Navigate via the sidebar." >> Home.md
|
echo "# RetroHA Developer Wiki" > Home.md
|
||||||
|
echo "Welcome to the autogenerated API documentation." >> Home.md
|
||||||
|
echo "" >> Home.md
|
||||||
|
if [ -d "shared" ]; then
|
||||||
|
echo "- [Shared Module API Reference](shared/index)" >> Home.md
|
||||||
|
fi
|
||||||
|
if [ -d "app" ]; then
|
||||||
|
echo "- [App Module API Reference](app/index)" >> Home.md
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|||||||
Reference in New Issue
Block a user