Skip to content

Commit

Permalink
[SPARK-45098][DOCS] Custom jekyll-rediect-from redirect.html template…
Browse files Browse the repository at this point in the history
… to fix doc redirecting

### What changes were proposed in this pull request?

In https://dist.apache.org/repos/dist/dev/spark/v3.5.0-rc4-docs/_site/, these links are supposed to redirect to the correct targets, but failed because there are no `.html` extensions.

- [building-with-maven.html](https://dist.apache.org/repos/dist/dev/spark/v3.5.0-rc4-docs/_site/building-with-maven.html)   ---> [building-spark.html](https://dist.apache.org/repos/dist/dev/spark/v3.5.0-rc4-docs/_site/building-spark.html)
- [sql-reference.html](https://dist.apache.org/repos/dist/dev/spark/v3.5.0-rc4-docs/_site/sql-reference.html) ---> [sql-ref.html](https://dist.apache.org/repos/dist/dev/spark/v3.5.0-rc4-docs/_site/sql-ref.html)

This PR customs the redirect template to add extensions to fix this issue. Referencing https://github.com/jekyll/jekyll-redirect-from#customizing-the-redirect-template

### Why are the changes needed?

Fix doc links, such as https://spark.apache.org/docs/latest/sql-reference.html

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

Build doc and verify locally.

```html
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="/building-spark.html">
<script>location="/building-spark.html"</script>
<meta http-equiv="refresh" content="0; url=/building-spark.html">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="/building-spark.html">Click here if you are not redirected.</a>
</html>%
```

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #42848 from yaooqinn/SPARK-45098.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit 81bc38e)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
  • Loading branch information
yaooqinn authored and dongjoon-hyun committed Sep 8, 2023
1 parent 8f730e7 commit 0662175
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/_layouts/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="{{ page.redirect.to }}.html">
<script>location="{{ page.redirect.to }}.html"</script>
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}.html">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="{{ page.redirect.to }}.html">Click here if you are not redirected.</a>
</html>

0 comments on commit 0662175

Please sign in to comment.