Skip to content

Commit

Permalink
A few tweaks to the 404 page.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed Nov 9, 2014
1 parent 24bbc77 commit f8e1f49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 2 additions & 4 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,8 @@ def replace_alias(matchobj):
header_for_page = header_for_page.replace("{$api_commands}", api_commands)
header_for_page = header_for_page.replace("{$current_api}", latest_minor.replace(".", ""))
header_for_page = header_for_page.replace("{$command_versions}", "")
header_for_page = header_for_page.replace("{$command}", "404 - Page Not Found")

improvepage = "Think you can improve this page? <a href='https://github.com/BSVino/docs.gl/blob/master/html/404.html'>Edit this page</a> on <a href='https://github.com/BSVino/docs.gl/'>GitHub</a>."
footer_for_page = footer_for_page.replace("{$improvepage}", improvepage)
header_for_page = header_for_page.replace("{$command}", "Oops! Can't find '<span id='404command'></span>'.")
footer_for_page = footer_for_page.replace("{$improvepage}", "")

fp = open("html/404.html")
notfound_html = fp.read()
Expand Down
10 changes: 7 additions & 3 deletions html/404.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<div class="refentry" id="pagenotfound">
<div class="titlepage">
<p>The page you were looking for could not be found.</p>
<p>Try using the menu on the left, or the search at the top to find the command.</p>
<p>Try the menu on the left, or the search bar top right.</p>
</div>
</div>
<script src="../docs.gl.search.js"></script>
<script>
var alias_api = window.current_api.substring(0, 2);

var path404 = window.location.pathname
var cur_command = path404.substring(path404.lastIndexOf("/") + 1);
$("#404command").text(cur_command);

// I'm not the best with Javascript, but the 404 command name is set before loading
// the search .js in the hope that a slow search .js won't delay the command name.
</script>
<script src="../docs.gl.search.js"></script>
<script>
var alias_target = function_aliases[alias_api][cur_command];

if(typeof alias_target != 'undefined')
Expand Down

0 comments on commit f8e1f49

Please sign in to comment.