Skip to content

Commit 4abef46

Browse files
authored
[FSTORE-1346] Fix theme, latest redirect, dropdown and custom css (#372)
* Minimal changes * Add support for latest redirect
1 parent a2b04ae commit 4abef46

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

docs/css/custom.css

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:root {
1+
[data-md-color-scheme="hopsworks"] {
22
--md-primary-fg-color: #1eb382;
33
--md-secondary-fg-color: #188a64;
44
--md-tertiary-fg-color: #0d493550;
@@ -9,7 +9,6 @@
99
.md-footer__inner:not([hidden]) {
1010
display: none;
1111
}
12-
1312
/* Lex did stuff here */
1413
.svg_topnav {
1514
width: 12px;
@@ -24,6 +23,10 @@
2423
box-shadow: 0 0 0 0;
2524
}
2625

26+
.md-tabs__item {
27+
min-width: 2.5rem;
28+
}
29+
2730
.md-tabs__item:hover {
2831
background-color: var(--md-tertiary-fg-color);
2932
transition: background-color 450ms;

docs/css/dropdown.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ overflow: inherit;
1717

1818
/* The container <div> - needed to position the dropdown content */
1919
.dropdown {
20-
position: relative;
20+
position: absolute;
2121
display: inline-block;
2222
}
2323

docs/js/inject-api-links.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
window.addEventListener("DOMContentLoaded", function () {
22
var windowPathNameSplits = window.location.pathname.split("/");
33
var majorVersionRegex = new RegExp("(\\d+[.]\\d+)")
4+
var latestRegex = new RegExp("latest")
45
if (majorVersionRegex.test(windowPathNameSplits[1])) { // On landing page docs.hopsworks.api/3.0 - URL contains major version
56
// Version API dropdown
67
document.getElementById("hopsworks_api_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + windowPathNameSplits[1] + "/generated/api/login/";
78
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/";
99
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/";
1011
} 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+
}
1319
// Version main navigation
1420
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/";
1723
document.getElementsByClassName("md-tabs__link")[3].href = "https://docs.hopsworks.ai/" + majorVersion + "/concepts/hopsworks/";
1824
document.getElementsByClassName("md-tabs__link")[4].href = "https://docs.hopsworks.ai/" + majorVersion + "/user_guides/";
1925
document.getElementsByClassName("md-tabs__link")[5].href = "https://docs.hopsworks.ai/" + majorVersion + "/setup_installation/aws/getting_started/";
File renamed without changes.

mkdocs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ nav:
283283

284284
theme:
285285
name: material
286-
custom_dir: overrides
286+
custom_dir: docs/overrides
287287
favicon: assets/images/favicon.ico
288288
logo: assets/images/hops-logo.png
289289
icon:
@@ -293,6 +293,7 @@ theme:
293293
code: "IBM Plex Mono"
294294
palette:
295295
accent: teal
296+
scheme: hopsworks
296297
features:
297298
- navigation.tabs
298299
- navigation.tabs.sticky

0 commit comments

Comments
 (0)