Skip to content

Commit 980ec78

Browse files
committed
[repo] Correct cname and generate an index
1 parent 3ffe4e4 commit 980ec78

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.github/workflows/publish-apidocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ jobs:
4242
with:
4343
github_token: ${{ secrets.GITHUB_TOKEN }}
4444
publish_dir: ./build
45+
cname: phpdoc.moodledev.io

index.foot.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
</ul>
2+
</div>
3+
</body>
4+
</html>

index.head.tpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>PHP Documentation: Moodle</title>
5+
<link data-rh="true" rel="canonical" href="https://phpdocmoodledev.io/">
6+
</head>
7+
<body>
8+
<div role="main">
9+
<h1>PHP Documentation for Moodle</h1>
10+
<p>
11+
Documentation is available for the following branches:
12+
</p>
13+
<ul>

scripts/generate_api_docs.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ echo "= Versions: ${VERSIONLIST[*]}"
1515
echo "= Branches: ${BRANCHLIST[*]}"
1616
echo "============================================================================"
1717

18+
htmlbranchlist=""
19+
1820
for index in ${!VERSIONLIST[@]}; do
1921
version=${VERSIONLIST[$index]}
2022
moodlebranch=${BRANCHLIST[$index]}
@@ -57,8 +59,15 @@ for index in ${!VERSIONLIST[@]}; do
5759
echo "========================================"
5860
echo "== Completed documentation generation for ${version}"
5961
echo "========================================"
62+
63+
htmlbranchlist="${htmlbranchlist}
64+
<li><a href='./${version}'>Moodle ${version}</a></li>"
6065
done
6166

67+
cat "${ROOT}/index.head.tpl" > "${ROOT}/build/index.html"
68+
echo "${htmlbranchlist}" >> "${ROOT}/build/index.html"
69+
cat "${ROOT}/index.foot.tpl" >> "${ROOT}/build/index.html"
70+
6271
echo "============================================================================"
6372
echo "= Documentation build completed."
6473
echo "============================================================================"

0 commit comments

Comments
 (0)