Skip to content

Commit 7635204

Browse files
committed
[SPARK-53472][DOCS] Fix jekyll-redirect-from template and generated html files
### Why are the changes needed? `page.redirect.to` defaults to pages with the absolute site root. In this PR, we revise it to the docs relative. ### Does this PR introduce _any_ user-facing change? doc fix Check https://dist.apache.org/repos/dist/dev/spark/v4.0.1-rc1-docs/_site/ for https://dist.apache.org/repos/dist/dev/spark/v4.0.1-rc1-docs/_site/building-with-maven.html ### How was this patch tested? build docs locally. ### Was this patch authored or co-authored using generative AI tooling? no Closes #52217 from yaooqinn/SPARK-53472. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Kent Yao <yao@apache.org>
1 parent eea9767 commit 7635204

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/_layouts/redirect.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
<html lang="en-US">
2020
<meta charset="utf-8">
2121
<title>Redirecting&hellip;</title>
22-
<link rel="canonical" href="{{ page.redirect.to }}.html">
23-
<script>location="{{ page.redirect.to }}.html"</script>
24-
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}.html">
22+
{% assign redirect_url = page.redirect.to | replace_first: '/', '' | prepend: rel_path_to_root | append: '.html' %}
23+
<link rel="canonical" href="{{ redirect_url }}">
24+
<script>location="{{ redirect_url }}"</script>
25+
<meta http-equiv="refresh" content="0; url={{ redirect_url }}">
2526
<meta name="robots" content="noindex">
2627
<h1>Redirecting&hellip;</h1>
27-
<a href="{{ page.redirect.to }}.html">Click here if you are not redirected.</a>
28-
</html>
28+
<a href="{{ redirect_url }}">Click here if you are not redirected.</a>
29+
</html>

0 commit comments

Comments
 (0)