has children, default behavior (toggle checkbox) applies
});
});
+
+ // Mark Overview as current on root page. The overview content lives in
+ // index.md but Sphinx only marks toctree entries as "current" when the
+ // pagename matches. Since the Overview href is rewritten to "#" (self)
+ // on the root page, we detect that and add the current class.
+ document.querySelectorAll('.sidebar-tree .toctree-l1 > a[href="#"]').forEach((a) => {
+ a.classList.add('current');
+ a.closest('li').classList.add('current');
+ });
});
diff --git a/src/crate/theme/rtd/icons.py b/src/crate/theme/rtd/icons.py
new file mode 100644
index 00000000..5bee8b0d
--- /dev/null
+++ b/src/crate/theme/rtd/icons.py
@@ -0,0 +1,30 @@
+# Caption icons for sidebar navigation (inline SVGs with color accents)
+# Using primary brand color #19c0ea for accent elements
+
+ICON_BUILD = ''''''
+
+ICON_OPERATIONS = ''''''
+
+ICON_REFERENCE = ''''''
+
+ICON_TOOLS = ''''''
diff --git a/src/crate/theme/rtd/sidebartoc.py b/src/crate/theme/rtd/sidebartoc.py
index 079445b8..cef5089c 100644
--- a/src/crate/theme/rtd/sidebartoc.py
+++ b/src/crate/theme/rtd/sidebartoc.py
@@ -24,6 +24,8 @@
import os
import re
+from crate.theme.rtd.icons import ICON_BUILD, ICON_OPERATIONS, ICON_REFERENCE, ICON_TOOLS
+
def _slugify_id(text):
"""Normalize text to a safe HTML ID: alphanumerics and hyphens only."""
@@ -124,6 +126,7 @@ def _get_toctree(maxdepth=-1, titles_only=True, collapse=False):
parts.append('
')
- # Add Overview and top level entries defined in the Guide's toctree.
- # The Guide project is the only one that has multiple top-level entries.
+ # Add Guide's toctree entries (Overview, Getting Started, captions, etc.)
if project == 'CrateDB: Guide':
- if pagename == 'index':
- parts.append('
')
- parts.append(_get_toctree())
+ toctree_html = _get_toctree()
+ # Rewrite the Overview sidebar link to point to root (index.md)
+ # instead of overview/. The overview content lives in index.md;
+ # overview/index.md is only kept for toctree structure.
+ toctree_html = re.sub(
+ r'href="([^"]*overview/(?:index\.html)?)"',
+ f'href="{master_path}"',
+ toctree_html
+ )
+ # Add icons to captions
+ toctree_html = toctree_html.replace(
+ 'Build',
+ f'{ICON_BUILD}Build'
+ )
+ toctree_html = toctree_html.replace(
+ 'Operations',
+ f'{ICON_OPERATIONS}Operations'
+ )
+ parts.append(toctree_html)
else:
- # Show Overview link to Guide's index (no icon - it's just an index page)
- parts.append('