Skip to content

Commit

Permalink
better routing for menu, no removing beginning slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Michieljoris committed Jun 23, 2014
1 parent 276d6fe commit c16acd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.tern-port
node_modules/*

!node_modules/node-static
npm-debug.log
2 changes: 1 addition & 1 deletion src/html-builder.js
Expand Up @@ -238,7 +238,7 @@ function buildMenuTree(tree, hashBang) {
// '<ul id="nav" class="menu sf-menu">';
var str = '';
function removeSlashes(str) {
if (str[0] === '/') str = str.slice(1);
// if (str[0] === '/') str = str.slice(1); not good for routing!!
if (str[str.length-1] === '/') str = str.slice(0, str.length-1);
return str;
}
Expand Down

0 comments on commit c16acd6

Please sign in to comment.