Skip to content

Commit

Permalink
Add redirect from api/latest to the Javadoc of the latest release.
Browse files Browse the repository at this point in the history
Also:
- Added badges for the latest and snapshot versions of Javadocs.
- Fixed the whitespaces in the generated HTML files.
- Fixed the config so that the website works on local development servers.
- Removed some unused files.
- Added a basic 404 page.
  • Loading branch information
chaoren committed Jan 17, 2025
1 parent b16624c commit 2041486
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 139 deletions.
8 changes: 8 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
title: Page Not Found
---

# 404

The requested URL does not exist.
1 change: 0 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Guava
subtitle: Google core libraries for Java
description: Google core libraries for Java
baseurl: /
url: https://guava.dev

themeColor: red
Expand Down
6 changes: 3 additions & 3 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% comment %}
{%- comment -%}
Copyright (C) 2018 Google LLC.

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -11,8 +11,8 @@
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.foobar2
{% endcomment %}
limitations under the License.
{%- endcomment -%}

<footer class="c-footer">
<div class="u-container c-footer__container">
Expand Down
17 changes: 8 additions & 9 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% comment %}
{%- comment -%}
Copyright (C) 2018 Google LLC.

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -11,8 +11,8 @@
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.foobar2
{% endcomment %}
limitations under the License.
{%- endcomment -%}

<head>
<meta charset="utf-8">
Expand All @@ -22,12 +22,11 @@
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

<link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,700|Roboto+Mono:400,500' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,400italic,700|Roboto+Mono:400,500" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
{% if site.googleAnalyticsId %}
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
<link rel="canonical" href="{{ site.url }}{{ site.baseurl }}{{ page.url | replace: 'index.html', '' }}">
{%- if site.googleAnalyticsId %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Expand All @@ -37,5 +36,5 @@
ga('create', '{{ site.googleAnalyticsId }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
{%- endif %}
</head>
12 changes: 6 additions & 6 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% comment %}
{%- comment -%}
Copyright (C) 2018 Google LLC.

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -11,16 +11,16 @@
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.foobar2
{% endcomment %}
limitations under the License.
{%- endcomment -%}

<nav class="c-navigation {% if site.fixedNav == 'true' %}is-fixed{% endif %}">
<div class="c-navigation__container u-container">

{% for i in site.nav %}
{% assign url = i.item.url %}
{%- for i in site.nav %}
{%- assign url = i.item.url %}
<a class="c-navigation__item {% if page.url == url %}is-active{% endif %}" href="{{ url | prepend: site.baseurl }}">{{i.item.name}}</a>
{% endfor %}
{%- endfor %}

</div>
</nav>
39 changes: 0 additions & 39 deletions _includes/social.html

This file was deleted.

18 changes: 8 additions & 10 deletions _layouts/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% comment %}
{%- comment -%}
Copyright (C) 2018 Google LLC.

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,16 +12,14 @@
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 %}
{%- endcomment -%}

<!DOCTYPE html>
<html class="t-{{ site.themeColor }}">
{% include head.html %}
<body>
{% include navigation.html %}

{{ content }}

{% include footer.html %}
</body>
{% include head.html %}
<body>
{% include navigation.html %}
{{ content }}
{% include footer.html %}
</body>
</html>
3 changes: 2 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

layout: base
---

<article class="c-article">
<header class="c-header c-article__header">
<div class="u-container">
Expand All @@ -23,6 +24,6 @@ <h1 class="c-header__title">{{ page.title }}</h1>
</header>

<div class="c-article__main">
{{ content }}
{{ content }}
</div>
</article>
18 changes: 0 additions & 18 deletions _layouts/post.html

This file was deleted.

4 changes: 4 additions & 0 deletions _layouts/redirect.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{%- comment -%}
Template from https://github.com/jekyll/jekyll-redirect-from/blob/master/lib/jekyll-redirect-from/redirect.html
{%- endcomment -%}

<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
Expand Down
36 changes: 36 additions & 0 deletions api/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions api/latest/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions api/latest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# Template from https://github.com/jekyll/jekyll-redirect-from/blob/master/lib/jekyll-redirect-from/redirect.html
---
{%- capture redirect_to -%}
{{ site.baseurl }}/releases/{{ site.latest_release }}-jre/api/docs/
{%- endcapture -%}

<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="{{ redirect_to }}">
<script>location="{{ redirect_to }}"+location.hash</script>
<meta http-equiv="refresh" content="0; url={{ redirect_to }}">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="{{ redirect_to }}">Click here if you are not redirected.</a>
</html>
Binary file removed elements/GitHub-Mark-Light-32px.png
Binary file not shown.
52 changes: 0 additions & 52 deletions elements/github-fab.html

This file was deleted.

0 comments on commit 2041486

Please sign in to comment.