github.com/blystad/deis@v0.11.0/controller/web/static/js/checkURL.js (about)

     1  //Remove <ul> from Releases
     2  $('.toctree-l1 > a:contains("Releases")').siblings().remove();
     3  
     4  //Check URL
     5  var path = window.location.pathname.split('/');
     6  var cleanedPath = $.grep(path,function(n){ return(n) });
     7  
     8  // the second to last path segment is the section
     9  switch(cleanedPath[cleanedPath.length-2]) {
    10    case 'understanding_deis':
    11      $('.toctree-l1 > a:contains("Understanding Deis")').attr('state', 'open');
    12      break;
    13    case 'installing_deis':
    14      $('.toctree-l1 > a:contains("Installing Deis")').attr('state', 'open');
    15      break;
    16    case 'using_deis':
    17      $('.toctree-l1 > a:contains("Using Deis")').attr('state', 'open');
    18      break;
    19    case 'managing_deis':
    20      $('.toctree-l1 > a:contains("Managing Deis")').attr('state', 'open');
    21      break;
    22    case 'contributing':
    23      $('.toctree-l1 > a:contains("Contributing")').attr('state', 'open');
    24      break;
    25    case 'reference':
    26    case 'client':
    27    case 'server':
    28    case 'terms':
    29      $('.toctree-l1 > a:contains("Reference Guide")').attr('state', 'open');
    30      break;
    31    default:
    32      $('.toctree-l1 > a:contains("Version")').attr('state', 'close');
    33      break;
    34  }