mirror of https://github.com/docker/docs.git
Fixes for forwarding, custom 404
This commit is contained in:
parent
1465790db0
commit
b58c93bb40
7
404.md
7
404.md
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
layout: null
|
||||||
permalink: /404.html
|
permalink: /404.html
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -16,10 +17,12 @@ function doFwd() {
|
||||||
|
|
||||||
console.log(domainName + ":"+ portNumber +"/{{ item[0] }}");
|
console.log(domainName + ":"+ portNumber +"/{{ item[0] }}");
|
||||||
gonnaFwd = true;
|
gonnaFwd = true;
|
||||||
if(forwardingURL.indexOf(":")>-1) {
|
if(portNumber.length > 0) {
|
||||||
|
console.log("Port!");
|
||||||
// there is a port number in the location; make sure to replace it
|
// 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','' }}");
|
newURL = forwardingURL.replace(domainName + ":"+ portNumber +"/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}");
|
||||||
} else {
|
} else {
|
||||||
|
console.log("No port");
|
||||||
// no port number in the location; just foward them on
|
// no port number in the location; just foward them on
|
||||||
newURL = forwardingURL.replace(domainName + "/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}");
|
newURL = forwardingURL.replace(domainName + "/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}");
|
||||||
}
|
}
|
||||||
|
@ -29,7 +32,7 @@ function doFwd() {
|
||||||
console.log("Forwarding to: " + newURL);
|
console.log("Forwarding to: " + newURL);
|
||||||
window.location.replace(newURL);
|
window.location.replace(newURL);
|
||||||
} else {
|
} 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.location.replace("/sorry/#" + forwardingURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.onload = doFwd;
|
window.onload = doFwd;
|
||||||
|
|
|
@ -192,6 +192,7 @@ ng\:form {
|
||||||
<div {% if page.notoc %} class="col-xs-12 col-sm-9 col-md-10" {% else %} class="col-xs-12 col-sm-9 col-md-8 col-xl-9" {% endif %} >
|
<div {% if page.notoc %} class="col-xs-12 col-sm-9 col-md-10" {% else %} class="col-xs-12 col-sm-9 col-md-8 col-xl-9" {% endif %} >
|
||||||
<section class="section" id="DocumentationText">
|
<section class="section" id="DocumentationText">
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
{% if page.noratings != true %}
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<img src="/images/chat.png" alt="chat icon" style="margin-right: 10px">
|
<img src="/images/chat.png" alt="chat icon" style="margin-right: 10px">
|
||||||
<b>Feedback?</b> Questions? Suggestions?<br/>
|
<b>Feedback?</b> Questions? Suggestions?<br/>
|
||||||
|
@ -207,8 +208,8 @@ ng\:form {
|
||||||
};
|
};
|
||||||
(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
|
(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
title: "Sorry, we can't find that page :("
|
||||||
|
noratings: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Sorry, we can't find that page
|
||||||
|
|
||||||
|
<script language="JavaScript">
|
||||||
|
function populateTicket()
|
||||||
|
{
|
||||||
|
var output = new Array();
|
||||||
|
output.push("You can <a href='https://github.com/docker/docker.github.io/issues/new?title=404 at: ");
|
||||||
|
output.push(window.location.hash.replace("#",""));
|
||||||
|
output.push("&body=URL: ");
|
||||||
|
output.push(window.location.hash.replace("#",""));
|
||||||
|
output.push("' class='nomunge'>file a ticket</a> or <a href='/search/?q=");
|
||||||
|
output.push(window.location.hash.replace("#",""));
|
||||||
|
output.push("'>try a search</a>!");
|
||||||
|
document.getElementById("sorryMsg").innerHTML = output.join("");
|
||||||
|
}
|
||||||
|
window.onload = populateTicket;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
We tried to forward you to where we think you might be going, but we couldn't
|
||||||
|
find a good match.
|
||||||
|
|
||||||
|
<span id="sorryMsg" />
|
Loading…
Reference in New Issue