-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
404.html.haml
27 lines (22 loc) · 1.17 KB
/
404.html.haml
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
---
title: 404 Not Found
layout: base
---
.container
%h1 Page not found
%p We can't seem to find that page. Things may have shifted around during shipping, so it might be best to just start back at <a href="#{page.site_url}/index.html">the top of the site</a> and poke around for whatever it is you're looking for.
%h3 Other things to try:
%form{ :method=>'GET', :role=>'form', :action=>"#{page.site_url}/search.html", :onsubmit=>'return validate404SearchQuery()' }
%label.sr-only{ :for=>'404-search-query' } Query
%input.form-control{ :type=>'text', :name=>'q', :id=>'404-search-query', :size=>'40', :placeholder=>'Type something ..' }
%button{ :class=>'btn btn-default', :type=>'submit', } Google Search
:javascript
var searchQueryField = document.getElementById('404-search-query')
if (searchQueryField) {
searchQueryField.focus();
var brokenUrl = window.location.href;
if (brokenUrl.indexOf('/404.html') < 0) {
brokenUrl = decodeURI(brokenUrl).replace(/^[^\/]*\/\/[^\/]+/, '').replace(/(((\/index)?\.[^\.]+|[A-Z][a-z]+Home)$)/, '').replace(/[^-_a-z0-9]/ig, ' ').replace(/\s+/g, ' ').trim();
searchQueryField.value = brokenUrl;
}
}