Skip to content

Commit

Permalink
Fix platform menu for root site.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvkennedy committed Jan 23, 2024
1 parent 7e25d94 commit 7068fa1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tutorial/tutorial_sphinx_theme_1/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,25 @@
let root_pattern = new RegExp("(.*)\/([a-z0-9A-Z_]+\.html)","gm");
[].forEach.call(platform_api_links, function(el) {
href=window.location.href;
console.log("initDropdownLinks href "+href);
//console.log("initDropdownLinks href "+href);
platform_api=el.id.replace('-','/');
console.log("platform_api "+platform_api);
//console.log("platform_api "+platform_api);
if(href.match(pattern)==null)
{
if(href.match(root_pattern)==null)
{
href=href+"/"+platform_api);
}
else
{
href=href.replace(root_pattern,"$1/"+platform_api+"/$2");
console.log("1-> href "+href);
}
//console.log("1-> href "+href);
}
else
{
href=href.replace(pattern, platform_api);
console.log("2-> href "+href);
//console.log("2-> href "+href);
}
el.href=href;
////console.log("Adding target blank to "+el.id);
Expand Down

0 comments on commit 7068fa1

Please sign in to comment.