Skip to content

Commit

Permalink
docs: split into reusable .redirect-template.html
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Oct 9, 2023
1 parent d27ac8a commit ff34407
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/conda_and_docs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,10 @@ jobs:
name: DocumentationHTML
path: docs/build
- name: redirect to nightly
run: |
cat <<EOF > docs/build/index.html
<!DOCTYPE html>
<html lang="en-GB">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="$DESTINATION">
<script>location="$DESTINATION"</script>
<meta http-equiv="refresh" content="0; url=$DESTINATION">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="$DESTINATION">Click here if you are not redirected.</a>
</html>
env:
DESTINATION: https://tomographicimaging.github.io/CIL/nightly/
run: >
sed 's#DESTINATION#https://tomographicimaging.github.io/CIL/nightly/#g'
docs/.redirect-template.html
> docs/build/index.html
- name: Push changes
uses: casperdcl/push-dir@v1
with:
Expand Down
12 changes: 12 additions & 0 deletions docs/.redirect-template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<!-- largely based on https://github.com/jekyll/jekyll-redirect-from/blob/master/lib/jekyll-redirect-from/redirect.html -->
<html lang="en-GB">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="DESTINATION">
<script>location="DESTINATION"</script>
<meta http-equiv="refresh" content="0; url=DESTINATION">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="DESTINATION">Click here if you are not redirected.</a>
</html>

0 comments on commit ff34407

Please sign in to comment.