mirror of https://github.com/docker/docs.git
404 improvement follow-up (#2565)
This commit is contained in:
parent
737f3e3b3c
commit
88c7b88da5
39
404.md
39
404.md
|
@ -6,6 +6,14 @@ notoc: true
|
||||||
tree: false
|
tree: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
We tried to forward you to where we think you might be going, but we couldn't
|
||||||
|
find a good match. You've got some choices:
|
||||||
|
|
||||||
|
<div id="sorryMsg"></div>
|
||||||
|
|
||||||
|
<!-- Script needs to be at the bottom, after any content -->
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
var forwardingURL=window.location.pathname;
|
var forwardingURL=window.location.pathname;
|
||||||
if (forwardingURL.charAt(forwardingURL.length - 1) != "/") forwardingURL += "/";
|
if (forwardingURL.charAt(forwardingURL.length - 1) != "/") forwardingURL += "/";
|
||||||
|
@ -26,7 +34,7 @@ if (forwardingURL.indexOf(".md") > -1)
|
||||||
{% for item in site.data.docsarchive.docker-compose %}
|
{% for item in site.data.docsarchive.docker-compose %}
|
||||||
if (forwardingURL == "/{{ item[0] }}/")
|
if (forwardingURL == "/{{ item[0] }}/")
|
||||||
{
|
{
|
||||||
console.log("Found via Docker Compose file for Acrhive")
|
console.log("Found via Docker Compose file for Archive");
|
||||||
gonnaFwd = true;
|
gonnaFwd = true;
|
||||||
archive = true;
|
archive = true;
|
||||||
// make it so redirects cascade; first, use the base URL, then append path
|
// make it so redirects cascade; first, use the base URL, then append path
|
||||||
|
@ -55,7 +63,7 @@ if (archive==false) {
|
||||||
{
|
{
|
||||||
if (forwardingURL == aliases[i])
|
if (forwardingURL == aliases[i])
|
||||||
{
|
{
|
||||||
console.log("Found via Page Aliases on a multi-alias page @", "{{ page.url }}", aliases[i])
|
console.log("Found via Page Aliases on a multi-alias page @", "{{ page.url }}", aliases[i]);
|
||||||
gonnaFwd = true;
|
gonnaFwd = true;
|
||||||
newURL = "{{ page.url }}";
|
newURL = "{{ page.url }}";
|
||||||
}
|
}
|
||||||
|
@ -64,7 +72,7 @@ if (archive==false) {
|
||||||
// only one alias for this page.
|
// only one alias for this page.
|
||||||
if (forwardingURL == aliases)
|
if (forwardingURL == aliases)
|
||||||
{
|
{
|
||||||
console.log("Found via Page Aliases on a single-alias page @", forwardingURL.indexOf(aliases[i]), aliases[i])
|
console.log("Found via Page Aliases on a single-alias page @", forwardingURL.indexOf(aliases[i]), aliases[i]);
|
||||||
gonnaFwd = true;
|
gonnaFwd = true;
|
||||||
newURL = "{{ page.url }}";
|
newURL = "{{ page.url }}";
|
||||||
}
|
}
|
||||||
|
@ -83,28 +91,13 @@ if (gonnaFwd) {
|
||||||
window.location.href = newURL;
|
window.location.href = newURL;
|
||||||
document.write('<meta http-equiv="refresh" content="0; url=' + newURL + '">')
|
document.write('<meta http-equiv="refresh" content="0; url=' + newURL + '">')
|
||||||
} else {
|
} else {
|
||||||
function populateTicket()
|
console.log("Showing 404 choices");
|
||||||
{
|
var ghIssueQueryString = "title=404%20at%20" + path + "&body=URL%3A%20" + path;
|
||||||
var searchVal = phrase;
|
|
||||||
var output = new Array();
|
var output = new Array();
|
||||||
output.push("<ul><li><a href='https://github.com/docker/docker.github.io/issues/new?title=404 at: ");
|
output.push("<ul><li><a href='https://github.com/docker/docker.github.io/issues/new?" + ghIssueQueryString + "' class='nomunge'>File a ticket</a></li>");
|
||||||
output.push(path);
|
|
||||||
output.push("&body=URL: ");
|
|
||||||
output.push(path);
|
|
||||||
output.push("' class='nomunge'>File a ticket</a></li>");
|
|
||||||
output.push("<li><a href='/search/?q=" + phrase + "'</a>Search for <tt>"" + phrase + ""</tt></a></li>");
|
output.push("<li><a href='/search/?q=" + phrase + "'</a>Search for <tt>"" + phrase + ""</tt></a></li>");
|
||||||
output.push("<li><a href='/search/'>Try a different search</a></li>");
|
output.push("<li><a href='/search/'>Try a different search</a></li>");
|
||||||
output.push("<li><a href='/'>Go to the index</a></li></ul><br />");
|
output.push("<li><a href='/'>Go to the index</a></li></ul>");
|
||||||
document.getElementById("sorryMsg").innerHTML = output.join("");
|
document.getElementById('sorryMsg').innerHTML = output.join("");
|
||||||
}
|
|
||||||
window.onload = populateTicket;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
We tried to forward you to where we think you might be going, but we couldn't
|
|
||||||
find a good match. You've got some choices:
|
|
||||||
|
|
||||||
<span id="sorryMsg" />
|
|
||||||
|
|
||||||
|
|
17
README.md
17
README.md
|
@ -204,6 +204,12 @@ guidance about grammar, syntax, formatting, styling, language, or tone. If
|
||||||
something isn't clear in the guide, please submit an issue to let us know or
|
something isn't clear in the guide, please submit an issue to let us know or
|
||||||
submit a pull request to help us improve it.
|
submit a pull request to help us improve it.
|
||||||
|
|
||||||
|
### Testing changes and practical guidance
|
||||||
|
|
||||||
|
If you want to test a style change, or if you want to see how to achieve a
|
||||||
|
particular outcome with Markdown, Bootstrap, JQuery, or something else, have
|
||||||
|
a look at `test.md` (which renders in the site at `/test/`).
|
||||||
|
|
||||||
### Per-page front-matter
|
### Per-page front-matter
|
||||||
|
|
||||||
The front-matter of a given page is in a section at the top of the Markdown
|
The front-matter of a given page is in a section at the top of the Markdown
|
||||||
|
@ -260,6 +266,17 @@ references as you rename, add, and remove tabs.
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For more info and a few more permutations, see `test.md`.
|
||||||
|
|
||||||
|
### Running in-page Javascript
|
||||||
|
|
||||||
|
If you need to run custom Javascript within a page, and it depends upon JQuery
|
||||||
|
or Bootstrap, make sure the `<script>` tags are at the very end of the page,
|
||||||
|
after all the content. Otherwise the script may try to run before JQuery and
|
||||||
|
Bootstrap JS are loaded.
|
||||||
|
|
||||||
|
> **Note**: In general, this is a bad idea.
|
||||||
|
|
||||||
## Copyright and license
|
## Copyright and license
|
||||||
|
|
||||||
Code and documentation copyright 2017 Docker, inc, released under the Apache 2.0 license.
|
Code and documentation copyright 2017 Docker, inc, released under the Apache 2.0 license.
|
||||||
|
|
9
test.md
9
test.md
|
@ -347,6 +347,15 @@ break the Markdown block up. This example does it with Markdown. You can't have
|
||||||
break the Markdown block up.
|
break the Markdown block up.
|
||||||
{: style="column-count: 3 "}
|
{: style="column-count: 3 "}
|
||||||
|
|
||||||
|
## Running in-page Javascript
|
||||||
|
|
||||||
|
If you need to run custom Javascript within a page, and it depends upon JQuery
|
||||||
|
or Bootstrap, make sure the `<script>` tags are at the very end of the page,
|
||||||
|
after all the content. Otherwise the script may try to run before JQuery and
|
||||||
|
Bootstrap JS are loaded.
|
||||||
|
|
||||||
|
> **Note**: In general, this is a bad idea.
|
||||||
|
|
||||||
## Admonitions (notes)
|
## Admonitions (notes)
|
||||||
|
|
||||||
> **Note**: This is a note.
|
> **Note**: This is a note.
|
||||||
|
|
Loading…
Reference in New Issue