Skip to content

Latest commit

 

History

History
55 lines (51 loc) · 1.72 KB

404.md

File metadata and controls

55 lines (51 loc) · 1.72 KB
layout title permalink search_omit
default
404 Error
/404.html
true
<script> var all_docs = []; function redirectToCorrectPage() { {% for doc in site.documents %} all_docs.push("{{ site.baseurl }}{{ doc.url }}"); {% endfor %} console.log(all_docs); var url = window.location.toString(); if (url.slice(-1) === "/") { url = url.slice(0, -1); } console.log(url); // temporary, due to a specific situation var urls_to_handle = { 'http://www.opendatapolicies.org/Austin,TX(2013)': 'http://www.opendatapolicies.org/doc/austin-tx-2013-08-26/', 'http://www.opendatapolicies.org/Cincinnati,OH(20/?q=cincinnati': 'http://www.opendatapolicies.org/doc/cincinnati-oh-2014-05-29/', 'http://www.opendatapolicies.org/Denton,%20TX%20(2015/?q=denton': 'http://www.opendatapolicies.org/doc/denton-tx-2015-02-09/' } if (url in urls_to_handle) { console.log('before page redirect'); window.location = urls_to_handle[url]; console.log('after page redirect'); } var year_re = /http.+\d{4}$/; if (year_re.test(url)) { matching_urls = []; for (var i = 0; i < all_docs.length; i++) { if (all_docs[i].includes(url)) { matching_urls.push(all_docs[i]); } } console.log(matching_urls); if (matching_urls.length === 1) { window.location = matching_urls[0]; } else if (matching_urls.length > 1) { // replace this with the state page window.location = 'http://www.opendatapolicies.org/browse/' } else { window.location = 'http://www.opendatapolicies.org/browse/'; } } } window.onload = redirectToCorrectPage; </script>

Sorry, we can't find what you're looking for! Try going to our Browse page.