mirror of https://github.com/docker/docs.git
Move 404 script to 404 page, and improve link-generation
If we found a "referer" address, the body now contains the URL from which we arrived at the 404. For example; https://github.com/docker/docker.github.io/issues/new?title=404+at+%2Fnosuchpage&body=I+found+a+broken+link+%3A+https%3A%2F%2Fdocs.docker.com%2Fnosuchpage%0AI+arrived+on+this+page+through%3A+https%3A%2F%2Fdocs.docker.com%2Fregistry%2Fspec%2Fapi%2F Which opens a new ticket: Title: 404 at /nosuchpage I found a broken link : https://docs.docker.com/nosuchpage I arrived on this page through: https://docs.docker.com/registry/spec/api/ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2993c55840
commit
389f5d14d0
24
404.md
24
404.md
|
@ -7,10 +7,26 @@ skip_read_time: true
|
|||
---
|
||||
|
||||
There might be a mistake in the URL or you might've clicked a link to content
|
||||
that no longer exists.
|
||||
|
||||
If you think it's the latter, please file an issue at [https://github.com/docker/docker.github.io](https://github.com/docker/docker.github.io/issues/new)
|
||||
that no longer exists. If you think it's the latter, please file an issue in
|
||||
our [issue tracker on GitHub](https://github.com/docker/docker.github.io/issues/new)
|
||||
and let us know what happened. Please also include a link to where the error
|
||||
occurred, if applicable.
|
||||
|
||||

|
||||
[**Click here to create a new ticket**](https://github.com/docker/docker.github.io/issues/new){:.newissue.button.primary-btn}
|
||||
|
||||
|
||||
[](https://docs.docker.com/ "Go to the homepage")
|
||||
|
||||
<script>
|
||||
let el = document.querySelector("a.newissue");
|
||||
if (el) {
|
||||
let url = new URL("https://github.com/docker/docker.github.io/issues/new");
|
||||
url.searchParams.set("title", "404 at " + window.location.pathname);
|
||||
let body = "I found a broken link : " + window.location.href;
|
||||
if (document.referrer !== "") {
|
||||
body += "\nI arrived on this page through: " + document.referrer
|
||||
}
|
||||
url.searchParams.set("body", body);
|
||||
el.setAttribute("href", url.toString());
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -89,17 +89,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if page.path == "404.md" %}
|
||||
<script>
|
||||
var path = window.location.pathname.replace("#", "");
|
||||
var ghIssueQueryString = "https://github.com/docker/docker.github.io/issues/new?" + "title=404%20at%20" + path + "&body=URL%3A%20" + path;
|
||||
document.getElementsByClassName("nomunge")[1].onclick = function () {
|
||||
document.getElementsByClassName("nomunge")[1].href = ghIssueQueryString;
|
||||
return true;
|
||||
};
|
||||
</script>
|
||||
{% endif %}
|
||||
<footer class="footer">
|
||||
{% include footer.html %}
|
||||
</footer>
|
||||
|
|
Loading…
Reference in New Issue