-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle redirects with a custom 404 page instead of using jekyll-redir…
…ect-from. This allows us to redirect entire subtrees instead of just the root. All of the short link redirects can be generated in JavaScript when the website is built, so we longer need to create and check in hundreds of markdown files. Also: - Added badges for the latest and snapshot versions of Javadocs. - Added a redirect from /releases/latest/ to the latest version. - Fixed the whitespaces in the generated HTML files. - Fixed the config so that the website works on local development servers. - Removed some unused files.
- Loading branch information
Showing
792 changed files
with
165 additions
and
4,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: default | ||
title: Page Not Found | ||
redirects: | ||
/api: /releases/snapshot-jre/api/docs | ||
/releases/snapshot/: /releases/snapshot-jre/ | ||
/releases/latest/: /releases/{{site.latest_release}}-jre/ | ||
--- | ||
|
||
# 404 | ||
|
||
The requested URL does not exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{%- comment -%} | ||
Copyright (C) 2025 Google LLC. | ||
|
||
Licensed 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. | ||
{%- endcomment -%} | ||
|
||
<script> | ||
{%- for redirect in page.redirects %} | ||
{%- assign from = redirect[0] %} | ||
{%- assign to = redirect[1] | replace: "{{site.latest_release}}", site.latest_release %} | ||
{%- assign end = from | slice: -1 %} | ||
|
||
if ( | ||
{%- if end == "/" -%} | ||
location.pathname.startsWith('{{ site.baseurl }}{{ from }}') | ||
{%- else -%} | ||
(location.pathname + '/').startsWith('{{ site.baseurl }}{{ from }}/') | ||
{%- endif -%} | ||
) { | ||
location.pathname = location.pathname.replace('{{ from }}', '{{ to }}'); | ||
} | ||
|
||
{%- endfor %} | ||
|
||
switch (location.pathname.toLowerCase()) { | ||
{%- for file in site.static_files %} | ||
{%- if file.extname == ".html" | ||
and file.path contains "/snapshot-jre/api/docs/com/" %} | ||
{%- unless file.basename contains "-" | ||
or file.basename contains "." | ||
or file.path contains "/class-use/" %} | ||
case '{{ site.baseurl }}/{{ file.basename | downcase }}': | ||
case '{{ site.baseurl }}/{{ file.basename | downcase }}/': | ||
case '{{ site.baseurl }}/{{ file.basename | downcase }}/index.html': | ||
location.pathname = '{{ site.baseurl }}{{ file.path }}'; | ||
break; | ||
{%- endunless %} | ||
{%- endif %} | ||
{%- endfor %} | ||
} | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.