fix nav highlighting for trailing / and move to js file