Merge pull request #3 from thephred/add-docs-latest

Add a /doc/latest and fix issues with redirecting.
This commit is contained in:
Michael Goff 2018-12-04 08:29:55 -08:00 committed by GitHub
commit b5ffffccec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View File

@ -4,4 +4,4 @@
{% assign forumLink = "https://groups.google.com/forum/#!forum/crossplane-dev" %}
{% assign blogLink = "https://blog.upbound.io/" %}
{% assign communityMeetingLink = "https://github.com/crossplaneio/crossplane/#community-meeting" %}
{% assign latestDocs = site.data.versions[0].path %}
{% assign latestDocs = site.data.versions[0].path | append: '/' %}

View File

@ -31,7 +31,7 @@
<div class="versions{% if currentVersion == latestVersion %} latest{% endif %}">
<select onchange="window.location.href = this.value">
{% for ver in site.data.versions %}
<option {% if ver.version == currentVersion %}selected{% endif %} value="{{ver.path}}">Crossplane {{ ver.version }}</option>
<option {% if ver.version == currentVersion %}selected{% endif %} value="{{ver.path | append: '/'}}">Crossplane {{ ver.version }}</option>
{% endfor %}
</select>
</div>

18
docs/latest.html Normal file
View File

@ -0,0 +1,18 @@
---
layout: false
---
{% include values.inc %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redirecting...</title>
<link rel="canonical" href="{{ latestDocs }}"/>
<meta http-equiv="refresh" content="0;url={{ latestDocs }}" />
</head>
<body>
<h1>Redirecting...</h1>
<a href="{{ latestDocs }}">Click here if you are not redirected.<a>
<script>location='{{ latestDocs }}'</script>
</body>
</html>