File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
window . addEventListener ( "DOMContentLoaded" , function ( ) {
2
2
var windowPathNameSplits = window . location . pathname . split ( "/" ) ;
3
3
var majorVersionRegex = new RegExp ( "(\\d+[.]\\d+)" )
4
+ var latestRegex = new RegExp ( "latest" )
4
5
if ( majorVersionRegex . test ( windowPathNameSplits [ 1 ] ) ) { // On landing page docs.hopsworks.api/3.0 - URL contains major version
5
6
// Version API dropdown
6
7
document . getElementById ( "hopsworks_api_link" ) . href = "https://docs.hopsworks.ai/hopsworks-api/" + windowPathNameSplits [ 1 ] + "/generated/api/login/" ;
7
8
document . getElementById ( "hsfs_api_link" ) . href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits [ 1 ] + "/generated/api/connection_api/" ;
8
9
document . getElementById ( "hsml_api_link" ) . href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits [ 1 ] + "/generated/connection_api/" ;
9
10
} else { // on docs.hopsworks.api/feature-store-api/3.0 / docs.hopsworks.api/hopsworks-api/3.0 / docs.hopsworks.api/machine-learning-api/3.0
10
- var apiVersion = windowPathNameSplits [ 2 ] ;
11
- var majorVersion = apiVersion . match ( majorVersionRegex ) [ 0 ] ;
11
+ if ( latestRegex . test ( windowPathNameSplits [ 1 ] ) || latestRegex . test ( windowPathNameSplits [ 2 ] ) ) {
12
+ majorVersion = "latest" ;
13
+ } else {
14
+ var apiVersion = windowPathNameSplits [ 2 ] ;
15
+ var majorVersion = apiVersion . match ( majorVersionRegex ) [ 0 ] ;
16
+ }
12
17
// Version main navigation
13
18
document . getElementsByClassName ( "md-tabs__link" ) [ 0 ] . href = "https://docs.hopsworks.ai/" + majorVersion ;
14
19
document . getElementsByClassName ( "md-tabs__link" ) [ 1 ] . href = "https://colab.research.google.com/github/logicalclocks/hopsworks-tutorials/blob/master/quickstart.ipynb" ;
Original file line number Diff line number Diff line change 38
38
{% elif title == "API" %}
39
39
< li class ="md-tabs__item dropdown-api "> < button class ="dropbtn-api {{ class }} "> API </ button >
40
40
< div id ="myDropdown " class ="dropdown-content-api ">
41
- < a id ="hopsworks_api_link " href ="https://docs.hopsworks.ai/hopsworks-api/dev "> Hopsworks API</ a >
42
- < a id ="hsfs_api_link " href ="https://docs.hopsworks.ai/feature-store-api/dev "> Feature Store API</ a >
43
- < a id ="hsfs_javadoc_link " href ="https://docs.hopsworks.ai/feature-store-api/dev /javadoc "> Feature Store JavaDoc</ a >
44
- < a id ="hsml_api_link " href ="https://docs.hopsworks.ai/machine-learning-api/dev "> MLOps API</ a >
41
+ < a id ="hopsworks_api_link " href ="https://docs.hopsworks.ai/hopsworks-api/latest "> Hopsworks API</ a >
42
+ < a id ="hsfs_api_link " href ="https://docs.hopsworks.ai/feature-store-api/latest "> Feature Store API</ a >
43
+ < a id ="hsfs_javadoc_link " href ="https://docs.hopsworks.ai/feature-store-api/latest /javadoc "> Feature Store JavaDoc</ a >
44
+ < a id ="hsml_api_link " href ="https://docs.hopsworks.ai/machine-learning-api/latest "> MLOps API</ a >
45
45
</ div >
46
46
</ li >
47
47
You can’t perform that action at this time.
0 commit comments