Skip to content

Commit bf2eb40

Browse files
Merge pull request #10 from scriptautomate-bc/topic/enable-github-pages-preview
Move to pydata theme for unification
2 parents 2c54508 + 2ce72b4 commit bf2eb40

7 files changed

Lines changed: 201 additions & 14 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM bitnami/python:3.13
1+
FROM python:3.14
22

3-
RUN apt update && apt upgrade -y && apt install vim -y
3+
RUN apt-get update && apt-get upgrade -y && apt-get install vim -y
44

55
# Add dev requirements
66
ADD requirements.txt /tmp/

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Salt User Guide
2020
If you're looking to learn about Salt, you've come to the right place.
2121

2222
- `View the Sphinx-built documentation here <https://docs.saltproject.io/salt/user-guide/en/latest/index.html>`__
23-
- `View the source repo here <https://gitlab.com/saltstack/open/docs/salt-user-guide>`__
23+
- `View the source repo here <https://github.com/saltstack/salt-user-guide>`__
2424

2525
About the Salt User Guide
2626
=========================

docs/_templates/globaltoc.html

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<h3><a href="{{ pathto(root_doc)|e }}">{{ project|title }}</a></h3>
2+
<div id="salt-globaltoc">
3+
{{ toctree(includehidden=True, collapse=False, maxdepth=1) }}
4+
</div>
5+
6+
<style>
7+
#salt-globaltoc {
8+
font-size: 0.875rem;
9+
}
10+
11+
#salt-globaltoc ul {
12+
list-style: none;
13+
padding: 0;
14+
margin: 0 0 0.25rem 0;
15+
}
16+
17+
#salt-globaltoc p.caption {
18+
display: flex;
19+
align-items: center;
20+
gap: 0.4em;
21+
cursor: pointer;
22+
font-size: 0.75rem;
23+
font-weight: 700;
24+
text-transform: uppercase;
25+
letter-spacing: 0.08em;
26+
color: var(--pst-color-text-muted, #6c757d);
27+
padding: 0.35rem 0.25rem 0.35rem 0;
28+
margin: 0.75rem 0 0 0;
29+
user-select: none;
30+
}
31+
32+
#salt-globaltoc p.caption:hover {
33+
color: var(--pst-color-text-base, inherit);
34+
}
35+
36+
/* Triangle arrow indicator */
37+
#salt-globaltoc p.caption::before {
38+
content: "";
39+
display: inline-block;
40+
flex-shrink: 0;
41+
width: 0;
42+
height: 0;
43+
border-style: solid;
44+
border-width: 4px 0 4px 6px;
45+
border-color: transparent transparent transparent currentColor;
46+
transition: transform 0.15s ease;
47+
}
48+
49+
#salt-globaltoc p.caption.expanded::before {
50+
transform: rotate(90deg);
51+
}
52+
53+
#salt-globaltoc .toctree-l1 > a {
54+
display: block;
55+
padding: 0.25rem 0.5rem;
56+
color: var(--pst-color-text-base, inherit);
57+
text-decoration: none;
58+
border-radius: 4px;
59+
line-height: 1.4;
60+
}
61+
62+
#salt-globaltoc .toctree-l1 > a:hover {
63+
background-color: var(--pst-color-surface, rgba(0, 0, 0, 0.06));
64+
}
65+
66+
#salt-globaltoc .toctree-l1.current > a,
67+
#salt-globaltoc .toctree-l1.current > a:hover {
68+
font-weight: 600;
69+
background-color: var(--pst-color-surface, rgba(0, 0, 0, 0.06));
70+
color: var(--pst-color-primary, #0099cd);
71+
}
72+
</style>
73+
74+
<script>
75+
(function () {
76+
function initCollapsible() {
77+
var container = document.getElementById("salt-globaltoc");
78+
if (!container) return;
79+
80+
container.querySelectorAll("p.caption").forEach(function (caption) {
81+
var ul = caption.nextElementSibling;
82+
if (!ul || ul.tagName !== "UL") return;
83+
84+
if (ul.querySelector("li.current")) {
85+
caption.classList.add("expanded");
86+
} else {
87+
ul.style.display = "none";
88+
}
89+
90+
caption.addEventListener("click", function () {
91+
var isCollapsed = ul.style.display === "none";
92+
ul.style.display = isCollapsed ? "" : "none";
93+
caption.classList.toggle("expanded", isCollapsed);
94+
});
95+
});
96+
}
97+
98+
if (document.readyState === "loading") {
99+
document.addEventListener("DOMContentLoaded", initCollapsible);
100+
} else {
101+
initCollapsible();
102+
}
103+
})();
104+
</script>

docs/_templates/header-links.html

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<style>
2+
/* Styling for our custom links in the header center */
3+
.bd-header .navbar-nav {
4+
flex-direction: row !important;
5+
align-items: center !important;
6+
}
7+
8+
.bd-header .navbar-nav li.nav-item.custom-nav-item {
9+
margin: 0 0.75rem;
10+
}
11+
12+
.bd-header .navbar-nav li.nav-item.custom-nav-item a.nav-link {
13+
color: var(--color-foreground-secondary);
14+
text-decoration: none;
15+
font-weight: 500;
16+
font-size: 0.9rem;
17+
white-space: nowrap;
18+
padding: 0.5rem 0;
19+
transition: color 0.2s;
20+
}
21+
22+
.bd-header .navbar-nav li.nav-item.custom-nav-item a.nav-link:hover {
23+
color: var(--color-foreground-primary);
24+
}
25+
26+
.bd-header .navbar-nav li.nav-item.custom-nav-item.active a.nav-link {
27+
font-weight: 700;
28+
color: var(--pst-color-primary, var(--color-brand-primary, #0099cd));
29+
}
30+
31+
/* Style the globaltoc sidebar to look like PyData theme */
32+
.sidebar-primary-item .toctree-l1 {
33+
list-style: none;
34+
margin: 0;
35+
padding: 0;
36+
}
37+
.sidebar-primary-item .toctree-l1 > a {
38+
display: block;
39+
padding: 0.5rem 1rem;
40+
color: var(--color-foreground-secondary);
41+
text-decoration: none;
42+
font-size: 0.9rem;
43+
border-radius: 4px;
44+
}
45+
.sidebar-primary-item .toctree-l1 > a:hover {
46+
background-color: var(--color-sidebar-item-background--hover);
47+
color: var(--color-foreground-primary);
48+
}
49+
.sidebar-primary-item .toctree-l1.current > a {
50+
font-weight: 600;
51+
color: var(--color-brand-primary);
52+
}
53+
.sidebar-primary-item ul {
54+
padding-left: 1.5rem;
55+
list-style: none;
56+
}
57+
</style>
58+
59+
<!-- This template injects cross-doc navigation links into the navbar center -->
60+
<script>
61+
document.addEventListener("DOMContentLoaded", function() {
62+
const navbarCenter = document.querySelector(".navbar-header-items__center .navbar-nav");
63+
if (navbarCenter) {
64+
// Clear any existing (internal) links we don't want
65+
navbarCenter.innerHTML = "";
66+
67+
const links = [
68+
{ name: "Install Guide", url: "https://docs.saltproject.io/salt/install-guide/en/latest/" },
69+
{ name: "User Guide", url: "https://docs.saltproject.io/salt/user-guide/en/latest/", active: true },
70+
{ name: "Reference Docs", url: "https://docs.saltproject.io/en/latest/contents.html" }
71+
];
72+
73+
links.forEach(link => {
74+
const li = document.createElement("li");
75+
li.className = "nav-item custom-nav-item" + (link.active ? " active" : "");
76+
li.innerHTML = `<a class="nav-link" href="${link.url}">${link.name}</a>`;
77+
navbarCenter.appendChild(li);
78+
});
79+
}
80+
});
81+
</script>

docs/conf.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ def setup(app):
122122
# a list of builtin themes.
123123
#
124124

125-
# Base Material Theme requirements
126125
html_show_sourcelink = True # False on private repos; True on public repos
127-
html_theme = 'furo'
126+
html_theme = 'pydata_sphinx_theme'
128127
html_title = project
129128
html_baseurl = 'https://docs.saltproject.io/salt/user-guide/'
130129

@@ -136,13 +135,20 @@ def setup(app):
136135
"genindex.html",
137136
]
138137

138+
html_logo = None
139139
html_theme_options = {
140-
"dark_css_variables": {
141-
"color-brand-primary": "#66CCF4",
142-
"color-brand-content": "#66CCF4",
140+
"logo": {
141+
"image_light": "_static/img/SaltProject_altlogo_teal.png",
142+
"image_dark": "_static/img/SaltProject_altlogo_teal.png",
143143
},
144+
"navbar_start": ["navbar-logo"],
145+
"navbar_center": ["navbar-nav", "header-links"],
146+
"navbar_end": ["theme-switcher", "navbar-icon-links"],
147+
"navigation_depth": 4,
144148
}
145149

150+
html_sidebars = {"**": ["globaltoc.html"]}
151+
146152
# Add any paths that contain custom static files (such as style sheets) here,
147153
# relative to this directory. They are copied after the builtin static files,
148154
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -155,10 +161,6 @@ def setup(app):
155161
'css/local-testing.css'
156162
]
157163

158-
# The name of an image file (relative to this directory) to place at the top
159-
# of the sidebar.
160-
html_logo = "_static/img/SaltProject_altlogo_teal.png"
161-
162164
# The name of an image file (within the static path) to use as favicon of the
163165
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
164166
# pixels large. Favicons can be up to at least 228x228. PNG

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ Table of Contents
3939
:caption: Contribute
4040

4141
topics/list-of-images
42-
See a problem? Open an issue! <https://gitlab.com/saltstack/open/docs/salt-user-guide/-/issues>
42+
See a problem? Open an issue! <https://github.com/saltstack/salt-user-guide/issues>
4343
Salt docs contributing guide <https://saltstack.gitlab.io/open/docs/docs-hub/topics/contributing.html>
4444
GitLab repository <https://gitlab.com/saltstack/open/docs/salt-user-guide>

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Sphinx-Substitution-Extensions>=2022.2.16
2-
furo>=2022.12.7
2+
pydata-sphinx-theme
33
sphinx-copybutton>=0.5.1
44
sphinx-design>=0.3.0
55
sphinx-inline-tabs>=2022.1.2b11

0 commit comments

Comments
 (0)