forked from rosindex/rosindex
-
Notifications
You must be signed in to change notification settings - Fork 24
/
404.html
82 lines (73 loc) · 2.32 KB
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
layout: default
title: "404: Not Found"
---
<div class="container-fluid" style="margin-top:20px">
<div class="container-fluid">
<div class="row">
<div class="well" style="background-color: #EEE">
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<img width=320 src="{{ '/assets/404_icon.png' | prepend: site.baseurl }}">
</div>
<div class="col-md-6">
<h1>This isn't the page you're looking for...</h1>
<h2>Move along.</h2>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-offset-3 col-xs-6 text-center">
Did you get here from a link on ROS Index?
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-xs-offset-3 col-xs-6 text-center">
<a id="github_issue_link" target="_blank" href="" class="btn btn-sm btn-default btn-block">Report Broken Link</a>
</div>
</div>
<div class="row">
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
function updateGitHref() {
let githubLink = "https://github.com/ros-infrastructure/rosindex/issues/new?labels=bug&template=form404.yml";
// Get current url
var currentUrl = window.location.href;
if (!currentUrl) {
currentUrl = "";
}
// Get the url that brought us here
var referrerUrl = document.referrer;
if (!referrerUrl) {
referrerUrl = "";
}
// Encode the urls
var title = "title=Broken+Link:" + encodeURIComponent(currentUrl);
var currentUrl_encoded = "404page=" + encodeURIComponent(currentUrl);
var referrerUrl_encoded = "referrer=" + encodeURIComponent(referrerUrl);
// Update the href
githubLink += "&" + title + "&" + currentUrl_encoded + "&" + referrerUrl_encoded;
// Set the href
var githubIssueLink = $("#github_issue_link");
if (!githubIssueLink.length) {
console.error("Github issue link element is not available");
return;
}
githubIssueLink.attr("href", githubLink);
}
// Update the href
updateGitHref();
});
</script>