-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
8 lines (8 loc) · 1022 Bytes
/
404.html
File metadata and controls
8 lines (8 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
<!DOCTYPE html>
<html><head><script defer src="/main.js"></script><title>404 - Nobody</title></head>
</head>
<body>
<br><center><h1>404 Page Not Found</h1><p id="link">The Requested Page Was Not Found</p></center>
<br><div id="recommendations" style="margin:50px auto;text-align:left;max-width:600px;padding:1.5rem;"> </div><script>onload=()=>fetch("/pages.json").then(r=>r.json()).then(p=>{let x=location.pathname.toLowerCase().replace(/[^a-z0-9]/g,""),u=s=>new Set(s),i=(a,b)=>[...a].filter(c=>b.has(c)).length,f=a=>a.replace(/\.html?$/i,"");p=p.map(([a,t])=>[f(a),t]);let s=p.map(([a,t])=>({a,t,v:i(u(x),u(a.toLowerCase().replace(/[^a-z0-9]/g,"")))})).sort((a,b)=>b.v-a.v||a.t.localeCompare(b.t)).filter(e=>e.v);link.innerText=`"${location.hostname+location.pathname}" Was Not Found`;recommendations.innerHTML=s.length?`<p><b>Did you mean:</b></p><ul>${s.slice(0,5).map(e=>`<li><a href="${e.a}">${e.t}</a></li>`).join``}</ul>`:`<center><p>No similar pages found.</p></center>`});</script>
</body>
</html>