Skip to content

Commit 9e398a9

Browse files
committed
index.md
1 parent a5cc09b commit 9e398a9

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/documentation.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137

138138
- name: Add files to bypass nojekyll
139139
run: |
140-
touch _build/${{ needs.sphinx_docs.outputs.version-name }}/API/.nojekyll
140+
touch _build/${{ needs.sphinx_docs.outputs.version-name }}/.nojekyll
141141
142142
# Deploy files contain in _build directory on gh-pages branch
143143
- name: deploy-doc
@@ -167,19 +167,28 @@ jobs:
167167
- name: Write versions to JSON file
168168
run: |
169169
rm -f versions.json
170-
echo '[' > versions.json
170+
echo '[' >versions.json
171171
PREFIX=''
172-
for version in $(ls -d */); do
173-
echo -n "$PREFIX" >> versions.json
172+
for version in $(ls -d */ | sort -n); do
173+
echo -n "$PREFIX" >>versions.json
174174
PREFIX=','
175-
echo -n '{"url": "/alt-ergo/'$version'", "slug": "'${version%/}'"}' >> versions.json
175+
echo -n '{"url": "/alt-ergo/'$version'", "slug": "'${version%/}'"}' >>versions.json
176+
done
177+
echo -n ']' >>versions.json
178+
179+
- name: Write versions to index.md
180+
run: |
181+
rm -f index.md
182+
echo '# Alt-Ergo' >index.md
183+
echo 'Select the documentation for your version:' >>index.md
184+
for version in $(ls -d */ | sort -n); do
185+
echo " - [${version%/]($version)" >>index.md
176186
done
177-
echo -n ']' >> versions.json
178187
179188
- name: Push new versions
180189
run: |
181190
git config user.name github-actions
182191
git config user.email [email protected]
183-
git add versions.json
192+
git add versions.json index.md
184193
git commit -m 'Update versions.json' || exit 0
185194
git push

0 commit comments

Comments
 (0)