From 6e90842a931779f69b8ad4bf67eec9888f87cad2 Mon Sep 17 00:00:00 2001 From: Martin Weise <martin.weise@tuwien.ac.at> Date: Thu, 18 Jan 2024 12:17:50 +0100 Subject: [PATCH] Force same header for across versions --- .docs/overrides/main.html | 2 +- .docs/redirect.html | 10 ++++++---- .gitlab-ci.yml | 7 +++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.docs/overrides/main.html b/.docs/overrides/main.html index a637efc3f7..c5a0a0ab19 100644 --- a/.docs/overrides/main.html +++ b/.docs/overrides/main.html @@ -13,7 +13,7 @@ if (segments.length >= 4) { return segments[3] } else { - return '$TAG' + return '$VERSION' } } function switchVersion(value) { diff --git a/.docs/redirect.html b/.docs/redirect.html index 9c4c9805ee..de670e15b3 100644 --- a/.docs/redirect.html +++ b/.docs/redirect.html @@ -1,18 +1,20 @@ <!DOCTYPE html> <html lang="en"> +<!-- This file exists only once + in the final documentation --> <head> <meta charset="UTF-8"> <title>Redirect Notice</title> - <meta http-equiv="Refresh" content="0; url='https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/latest/'" /> + <meta http-equiv="Refresh" content="0; url='https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/'" /> </head> <body> <h1>Redirect Notice</h1> <p> - This page should automatically open the documentation for version <code>latest</code>. In case this page does not load the site is + This page should automatically open the documentation for version <code>$VERSION</code>. In case this page does not load the site is available at: </p> <p> - <a href="https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/latest/">https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/latest/</a> + <a href="https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/">https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/$VERSION/</a> </p> </body> -</html> +</html> \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8919d855e9..cbad2b94b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -595,6 +595,7 @@ docs-latest: - pip install -r ./requirements.txt - mkdir -p ./final - find ./.docs -type f -exec sed -i -e "s/\$TAG/latest/g" {} \; + - find ./.docs -type f -exec sed -i -e "s/\$VERSION/${VERSION}/g" {} \; - mkdocs build && cp -r ./site ./final/latest - cp ./.docs/redirect.html ./final/index.html - cp -r ./swagger/latest ./final/latest/swagger @@ -619,9 +620,10 @@ docs-1.3: - release-v1.3 - release-v1.4 script: - - apt-get update && apt-get install -y git make + - apt-get update && apt-get install -y git make wget - git fetch && git checkout release-v1.3 - pip install -r ./.docs/requirements.txt + - wget https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/overrides/main.html -O .docs/overrides/main.html -q - mkdir -p ./final - mkdocs build && cp -r ./site ./final/1.3.9 - cp -r ./swagger/1.3.9 ./final/1.3.9/swagger @@ -647,9 +649,10 @@ docs-1.4: - release-v1.3 - release-v1.4 script: - - apt-get update && apt-get install -y git make sed + - apt-get update && apt-get install -y git make sed wget - git fetch && git checkout release-v1.4 - pip install -r ./.docs/requirements.txt + - wget https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.docs/overrides/main.html -O .docs/overrides/main.html -q - mkdir -p ./final - find ./.docs -type f -exec sed -i -e "s/\$TAG/${VERSION}/g" {} \; - mkdocs build && cp -r ./site ./final/${VERSION} -- GitLab