File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 99
1010import  { latest_dir_name  } from  ' ../../../astro.config.mjs'  ;
1111
12+ <style >{ ` .hero { display: none; } ` } </style >
13+ 
1214<script >{ ` 
1315window.onload = function () { 
1416  const latest_dir_name = '${ latest_dir_name  }'; 
1517  const path = window.location.pathname; 
1618  // redirect /latest to the latest version 
1719  if (path.startsWith('/latest')) { 
1820      window.location.replace('/' + latest_dir_name + '/' + path.slice(path.length == 7 ? 7 : 8)) 
21+       return; 
1922  } 
2023  // redirect a semver (/2.0.1) to a directory name (/2_0) 
2124  let parts = path.match(/^\\ /(?<major>[0-9]+)\\ .(?<minor>[0-9])+\\ .[0-9]+(?<rest>\\ /.*)?$/)?.groups; 
2225  if (parts) { 
23-       window.location.replace('/' + parts['major'] + '_' + parts['minor'] + (parts['rest'] || '')) 
26+       window.location.replace('/' + parts['major'] + '_' + parts['minor'] + (parts['rest'] || '')); 
27+       return; 
2428  } 
29+   document.getElementsByClassName('hero')[0].style = "display: inherit;"; 
2530}; 
2631` } </script >
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments