|
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 |
| - document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits[1] + "/generated/connection_api/"; |
9 | 9 | document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits[1] + "/javadoc";
|
| 10 | + document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits[1] + "/generated/connection_api/"; |
10 | 11 | } 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
|
11 |
| - var apiVersion = windowPathNameSplits[2]; |
12 |
| - var majorVersion = apiVersion.match(majorVersionRegex)[0]; |
| 12 | + |
| 13 | + if (latestRegex.test(windowPathNameSplits[2]) || latestRegex.test(windowPathNameSplits[1])) { |
| 14 | + var majorVersion = "latest"; |
| 15 | + } else { |
| 16 | + var apiVersion = windowPathNameSplits[2]; |
| 17 | + var majorVersion = apiVersion.match(majorVersionRegex)[0]; |
| 18 | + } |
13 | 19 | // Version main navigation
|
14 | 20 | document.getElementsByClassName("md-tabs__link")[0].href = "https://docs.hopsworks.ai/" + majorVersion;
|
15 |
| - document.getElementsByClassName("md-tabs__link")[1].href = "https://docs.hopsworks.ai/" + majorVersion + "/getting_started/quickstart/"; |
16 |
| - document.getElementsByClassName("md-tabs__link")[2].href = "https://docs.hopsworks.ai/" + majorVersion + "/tutorials/fraud_batch/1_feature_groups/"; |
| 21 | + document.getElementsByClassName("md-tabs__link")[1].href = "https://colab.research.google.com/github/logicalclocks/hopsworks-tutorials/blob/master/quickstart.ipynb"; |
| 22 | + document.getElementsByClassName("md-tabs__link")[2].href = "https://docs.hopsworks.ai/" + majorVersion + "/tutorials/"; |
17 | 23 | document.getElementsByClassName("md-tabs__link")[3].href = "https://docs.hopsworks.ai/" + majorVersion + "/concepts/hopsworks/";
|
18 | 24 | document.getElementsByClassName("md-tabs__link")[4].href = "https://docs.hopsworks.ai/" + majorVersion + "/user_guides/";
|
19 | 25 | document.getElementsByClassName("md-tabs__link")[5].href = "https://docs.hopsworks.ai/" + majorVersion + "/setup_installation/aws/getting_started/";
|
|
0 commit comments