-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
55 lines (52 loc) · 2.19 KB
/
Copy path404.html
File metadata and controls
55 lines (52 loc) · 2.19 KB
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
---
layout: default
title: Error 404
---
<div id="home" class="grid post">
<div class="unit whole">
<h1>Sorry. Looks like the bit you requested does not exist.</h1>
<p class="not-found-path"><code id="not-found-path"></code></p>
<form class="not-found-search" action="/search.html" method="get" role="search">
<label for="not-found-search-input" class="visually-hidden">Search</label>
<input type="search" id="not-found-search-input" name="query" placeholder="Search…" autocomplete="off" enterkeyhint="search">
<button type="submit">Search</button>
</form>
<nav class="not-found-nav" aria-label="Site sections">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/archive/">Archive</a></li>
<li><a href="/timeline/">Timeline</a></li>
<li><a href="/projects/">Projects</a></li>
<li><a href="/tags/">Tags</a></li>
<li><a href="/sitemap.html">Site map</a></li>
</ul>
</nav>
<script>
(function(){
var path = location.pathname || '';
var qs = location.search || '';
var el = document.getElementById('not-found-path');
if (el) el.textContent = path + qs;
// WordPress-era date archives: /YYYY/ or /YYYY/MM/ -> /archive/YYYY/
var dm = path.match(/^\/((?:19|20)\d{2})\/(?:\d{1,2}\/?)?$/);
if (dm) { location.replace('/archive/' + dm[1] + '/'); return; }
var hint = '';
var m;
if (m = path.match(/^\/android-app-(.+?)\/?$/)) hint = m[1].replace(/-/g, ' ');
else if (m = path.match(/^\/android-game-(.+?)\/?$/)) hint = m[1].replace(/-/g, ' ');
else if (m = path.match(/^\/android-apps\/[^\/]+\/(.+?)\/?$/)) hint = m[1].replace(/[-_]/g, ' ');
else if (m = path.match(/^\/popular-open-source-projects\/(.+?)\/?$/)) hint = m[1].replace(/[-_]/g, ' ');
else if (m = path.match(/^\/category\/(.+?)\/?$/)) hint = m[1].replace(/[-_\/]/g, ' ');
else if (m = path.match(/^\/about\/(.+?)\/?$/)) hint = m[1].replace(/-/g, ' ');
else if (m = qs.match(/[?&]s=([^&]+)/)) hint = decodeURIComponent(m[1]).replace(/\+/g, ' ');
else if (m = path.match(/^\/([a-z][a-z0-9-]+)\/?$/)) hint = m[1].replace(/-/g, ' ');
var input = document.getElementById('not-found-search-input');
if (input && hint) {
input.value = hint;
input.focus();
input.select();
}
})();
</script>
</div>
</div>