mirror of https://github.com/docker/docs.git
Custom 404, Docs Archive, Archive Forwarding
This commit is contained in:
parent
d53c6798c9
commit
1465790db0
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
permalink: /404.html
|
||||
---
|
||||
|
||||
<script language="JavaScript">
|
||||
function doFwd() {
|
||||
var forwardingURL=window.location.href;
|
||||
var domainName = window.location.hostname;
|
||||
var portNumber = window.location.port;
|
||||
var gonnaFwd = false;
|
||||
var newURL = "";
|
||||
console.log(forwardingURL,domainName,portNumber);
|
||||
{% for item in site.data.docsarchive.docker-compose %}
|
||||
if (forwardingURL.indexOf("/{{ item[0] }}") > -1)
|
||||
{
|
||||
|
||||
console.log(domainName + ":"+ portNumber +"/{{ item[0] }}");
|
||||
gonnaFwd = true;
|
||||
if(forwardingURL.indexOf(":")>-1) {
|
||||
// there is a port number in the location; make sure to replace it
|
||||
newURL = forwardingURL.replace(domainName + ":"+ portNumber +"/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}");
|
||||
} else {
|
||||
// no port number in the location; just foward them on
|
||||
newURL = forwardingURL.replace(domainName + "/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}");
|
||||
}
|
||||
|
||||
}{% endfor %}
|
||||
if (gonnaFwd) {
|
||||
console.log("Forwarding to: " + newURL);
|
||||
window.location.replace(newURL);
|
||||
} else {
|
||||
document.getElementById("DocumentationText").innerHTML = "<h1>404</h1>Sorry, we can't find that page. Feel free to <a href='https://github.com/docker/docker.github.io/issues/new?title=404 at: " + forwardingURL + "&body=URL: "+ forwardingURL +"' class='nomunge'>file a ticket</a> and let us know!";
|
||||
}
|
||||
}
|
||||
window.onload = doFwd;
|
||||
</script>
|
63
_config.yml
63
_config.yml
|
@ -23,65 +23,4 @@ defaults:
|
|||
type: "pages"
|
||||
values:
|
||||
layout: docs
|
||||
|
||||
menu:
|
||||
- main:
|
||||
name: "Component Projects"
|
||||
identifier: "mn_components"
|
||||
weight: 8
|
||||
- main:
|
||||
name: "About"
|
||||
identifier: "mn_about"
|
||||
weight: 9
|
||||
- main:
|
||||
name: "Docs archive"
|
||||
identifier: "mn_versions"
|
||||
weight: 10
|
||||
- main:
|
||||
name: "Version 1.11"
|
||||
identifier: "smn_eleven"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.11/"
|
||||
weight: -11
|
||||
- main:
|
||||
name: "Version 1.10"
|
||||
identifier: "smn_ten"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.10/"
|
||||
weight: -10
|
||||
- main:
|
||||
name: "Version 1.9"
|
||||
identifier: "smn_nineteen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.9/"
|
||||
weight: -9
|
||||
- main:
|
||||
name: "Version 1.8"
|
||||
identifier: "smn_eightteen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.8/"
|
||||
weight: -8
|
||||
- main:
|
||||
name: "Version 1.7"
|
||||
identifier: "smn_seventeen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.7/"
|
||||
weight: -7
|
||||
- main:
|
||||
name: "Version 1.6"
|
||||
identifier: "smn_sixteen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.6/"
|
||||
weight: -6
|
||||
- main:
|
||||
name: "Version 1.5"
|
||||
identifier: "smn_fifteen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.5/"
|
||||
weight: -5
|
||||
- main:
|
||||
name: "Version 1.4"
|
||||
identifier: "smn_fourteen"
|
||||
parent: "mn_versions"
|
||||
url: "http://docs.docker.com/v1.4/"
|
||||
weight: -4
|
||||
archiveserver: "54.71.194.30"
|
||||
|
|
|
@ -1369,21 +1369,5 @@ toc:
|
|||
title: Docker Release Notes
|
||||
- path: /engine/reference/glossary/
|
||||
title: Docker Glossary
|
||||
- sectiontitle: Docs archive
|
||||
section:
|
||||
- path: http://docs.docker.com/v1.11/
|
||||
title: Version 1.11
|
||||
- path: http://docs.docker.com/v1.10/
|
||||
title: Version 1.10
|
||||
- path: http://docs.docker.com/v1.9/
|
||||
title: Version 1.9
|
||||
- path: http://docs.docker.com/v1.8/
|
||||
title: Version 1.8
|
||||
- path: http://docs.docker.com/v1.7/
|
||||
title: Version 1.7
|
||||
- path: http://docs.docker.com/v1.6/
|
||||
title: Version 1.6
|
||||
- path: http://docs.docker.com/v1.5/
|
||||
title: Version 1.5
|
||||
- path: http://docs.docker.com/v1.4/
|
||||
title: Version 1.4
|
||||
- title: Docs archive
|
||||
path: /docsarchive/
|
||||
|
|
|
@ -201,7 +201,7 @@ ng\:form {
|
|||
<script type="text/javascript">
|
||||
PDRTJS_settings_8453675 = {
|
||||
"id" : "8453675",
|
||||
"unique_id" : "default",
|
||||
"unique_id" : "{{ page.path }}",
|
||||
"title" : "{{ page.title }}",
|
||||
"permalink" : "{{ page.path }}"
|
||||
};
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: Documentation Archive
|
||||
---
|
||||
|
||||
# Documentation Archive
|
||||
|
||||
This page lists the various ways you can view the docs as they were when a
|
||||
prior version of Docker was shipped.
|
||||
|
||||
## View the docs archives locally
|
||||
|
||||
The docs archive is published as a [Docker repository at docs/archive](https://hub.docker.com/r/docs/archive/tags/).
|
||||
To see any of these versions, run the following command, changing
|
||||
the tag from `v1.4` to any tag you see in [the repo](https://hub.docker.com/r/docs/archive/tags/):
|
||||
|
||||
```shell
|
||||
docker run -p 4000:4000 docs/archive:v1.4
|
||||
```
|
||||
|
||||
The docs for `v1.4` will then be viewable at `http://localhost:4000`.
|
||||
|
||||
## Viewing the docs archives online
|
||||
|
||||
[This Docker Compose file](https://github.com/docker/docker.github.io/blob/master/_data/docsarchive/docker-compose.yml)
|
||||
is used to stand up the images in docs/archive on an AWS instance, using the
|
||||
following locations.
|
||||
|
||||
{% for item in site.data.docsarchive.docker-compose %}
|
||||
|
||||
### {{ item[0] }}
|
||||
|
||||
Docs for {{ item[0] }} are at [http://54.71.194.30:{{ item[1].ports[0] | replace:':4000','' }}](http://54.71.194.30:{{ item[1].ports[0] | replace:':4000','' }})
|
||||
|
||||
{% endfor %}
|
Loading…
Reference in New Issue