forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom 404, Docs Archive, Archive Forwarding
- Loading branch information
1 parent
d53c679
commit 1465790
Showing
5 changed files
with
74 additions
and
81 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,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> |
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,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 %} |