diff --git a/docs/css/custom.css b/docs/css/custom.css index ac643adff..18236a29f 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -1,4 +1,4 @@ -:root { +[data-md-color-scheme="hopsworks"] { --md-primary-fg-color: #1eb382; --md-secondary-fg-color: #188a64; --md-tertiary-fg-color: #0d493550; @@ -9,7 +9,6 @@ .md-footer__inner:not([hidden]) { display: none; } - /* Lex did stuff here */ .svg_topnav { width: 12px; @@ -24,6 +23,10 @@ box-shadow: 0 0 0 0; } +.md-tabs__item { + min-width: 2.5rem; +} + .md-tabs__item:hover { background-color: var(--md-tertiary-fg-color); transition: background-color 450ms; diff --git a/docs/css/dropdown.css b/docs/css/dropdown.css index e1d672432..c1c768fa2 100644 --- a/docs/css/dropdown.css +++ b/docs/css/dropdown.css @@ -17,7 +17,7 @@ overflow: inherit; /* The container
- needed to position the dropdown content */ .dropdown { - position: relative; + position: absolute; display: inline-block; } diff --git a/docs/js/inject-api-links.js b/docs/js/inject-api-links.js index 8e05a50b6..156650f66 100644 --- a/docs/js/inject-api-links.js +++ b/docs/js/inject-api-links.js @@ -1,19 +1,25 @@ window.addEventListener("DOMContentLoaded", function () { var windowPathNameSplits = window.location.pathname.split("/"); var majorVersionRegex = new RegExp("(\\d+[.]\\d+)") + var latestRegex = new RegExp("latest") if (majorVersionRegex.test(windowPathNameSplits[1])) { // On landing page docs.hopsworks.api/3.0 - URL contains major version // Version API dropdown document.getElementById("hopsworks_api_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + windowPathNameSplits[1] + "/generated/api/login/"; document.getElementById("hsfs_api_link").href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits[1] + "/generated/api/connection_api/"; - document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits[1] + "/generated/connection_api/"; document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits[1] + "/javadoc"; + document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits[1] + "/generated/connection_api/"; } 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 - var apiVersion = windowPathNameSplits[2]; - var majorVersion = apiVersion.match(majorVersionRegex)[0]; + + if (latestRegex.test(windowPathNameSplits[2]) || latestRegex.test(windowPathNameSplits[1])) { + var majorVersion = "latest"; + } else { + var apiVersion = windowPathNameSplits[2]; + var majorVersion = apiVersion.match(majorVersionRegex)[0]; + } // Version main navigation document.getElementsByClassName("md-tabs__link")[0].href = "https://docs.hopsworks.ai/" + majorVersion; - document.getElementsByClassName("md-tabs__link")[1].href = "https://docs.hopsworks.ai/" + majorVersion + "/getting_started/quickstart/"; - document.getElementsByClassName("md-tabs__link")[2].href = "https://docs.hopsworks.ai/" + majorVersion + "/tutorials/fraud_batch/1_feature_groups/"; + document.getElementsByClassName("md-tabs__link")[1].href = "https://colab.research.google.com/github/logicalclocks/hopsworks-tutorials/blob/master/quickstart.ipynb"; + document.getElementsByClassName("md-tabs__link")[2].href = "https://docs.hopsworks.ai/" + majorVersion + "/tutorials/"; document.getElementsByClassName("md-tabs__link")[3].href = "https://docs.hopsworks.ai/" + majorVersion + "/concepts/hopsworks/"; document.getElementsByClassName("md-tabs__link")[4].href = "https://docs.hopsworks.ai/" + majorVersion + "/user_guides/"; document.getElementsByClassName("md-tabs__link")[5].href = "https://docs.hopsworks.ai/" + majorVersion + "/setup_installation/aws/getting_started/"; diff --git a/overrides/main.html b/docs/overrides/main.html similarity index 100% rename from overrides/main.html rename to docs/overrides/main.html diff --git a/mkdocs.yml b/mkdocs.yml index e2ea85026..498cd3ae8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -283,7 +283,7 @@ nav: theme: name: material - custom_dir: overrides + custom_dir: docs/overrides favicon: assets/images/favicon.ico logo: assets/images/hops-logo.png icon: @@ -293,6 +293,7 @@ theme: code: "IBM Plex Mono" palette: accent: teal + scheme: hopsworks features: - navigation.tabs - navigation.tabs.sticky