aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorHenrik Tjäder <henrik@grepit.se>2022-02-09 21:52:05 +0100
committerHenrik Tjäder <henrik@grepit.se>2022-02-10 09:54:14 +0100
commit780b3672ca219196a6e990b4fa6590815537e374 (patch)
tree6beeb28261512a1f4929799bbc051f2e782c6f13 /.github
parent4a7951121db71ff075bf5a8eb2cb3760c65ace7a (diff)
Link dev-book to stable if they are describe the same release
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9d61cc0..923c30f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -479,8 +479,18 @@ jobs:
sed "s|URL|$stable|g" redirect.html > $td/index.html
# Create the redirects for dev-version
- sed 's|URL|rtic/index.html|g' redirect.html > $td/$devver/api/index.html
- sed 's|URL|book/en|g' redirect.html > $td/$devver/index.html
+ # If the current stable and the version being built differ,
+ # then there is a dev-version and the links should point to it.
+ if [[ "$stable" != "{{ env.versionmajor }}" ]];
+ then
+ sed 's|URL|rtic/index.html|g' redirect.html > $td/$devver/api/index.html
+ sed 's|URL|book/en|g' redirect.html > $td/$devver/index.html
+ else
+ # If the current stable and the "dev" version in master branch
+ # share the same major version, redirect dev/ to stable book
+ sed 's|URL|rtic.rs/$stable/api/rtic|g' redirect.html > $td/$devver/api/index.html
+ sed 's|URL|rtic.rs/$stable|g' redirect.html > $td/$devver/index.html
+ fi
# Build books
for lang in ${langs[@]}; do