From 07ea5723476347d9c59b804a2d91f2487c2f920f Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 4 Nov 2026 19:42:44 -0800 Subject: [PATCH 01/16] Show the docs menu on /docs/ and link it as Overview /docs/ was a full-width block page without the documentation menu. It now uses the left-aside docs layout with the menu, and the menu starts with an "Overview" link to /docs/ on every docs page, marked as current on /docs/ itself. The routing blocks wrap to fit the narrower column. Signed-off-by: Madelyn Olson --- content/docs/index.md | 4 +--- sass/_valkey.scss | 21 ++++++++++++++------- templates/block-menu.html | 8 -------- templates/docs-landing.html | 23 +++++++++++++++++++++++ templates/macros/nav.html | 6 ++++-- 5 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 templates/block-menu.html create mode 100644 templates/docs-landing.html diff --git a/content/docs/index.md b/content/docs/index.md index 2086a7b7..527ac11b 100644 --- a/content/docs/index.md +++ b/content/docs/index.md @@ -1,9 +1,7 @@ +++ title = "Documentation" -template = "block-menu.html" +template = "docs-landing.html" page_template = "docs-page.html" -[extra] -body_class= "blocks-page" +++ diff --git a/sass/_valkey.scss b/sass/_valkey.scss index c49e0f05..49702698 100644 --- a/sass/_valkey.scss +++ b/sass/_valkey.scss @@ -642,6 +642,19 @@ p { padding-bottom: 1rem; } + // The link to the documentation overview, which looks like a section title. + // It has no border unless it's current, so it lines up with the titles. + .docs-menu-overview > a { + padding: 1rem 0.4rem; + font-weight: 700; + color: #000; + text-transform: uppercase; + + &:not(.docs-menu-current) { + border-left: 0; + } + } + .docs-menu-current { background-color: #d1d9ff; border-left-color: #2054B2; @@ -1659,7 +1672,7 @@ pre table { li { text-align: center; padding: 1em; - flex: 1 1 0px; + flex: 1 1 25rem; a { text-align: center; padding-bottom: 1em; @@ -1668,12 +1681,6 @@ pre table { } } -.blocks-page { - .container { - padding-right: 0; - } -} - @media (max-width: 768px) { .block-menu ul { display: block; diff --git a/templates/block-menu.html b/templates/block-menu.html deleted file mode 100644 index 2a906473..00000000 --- a/templates/block-menu.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "fullwidth.html" %} - - -{% block main_content %} -
-{{ page.content | markdown | safe }} -
-{% endblock main_content %} diff --git a/templates/docs-landing.html b/templates/docs-landing.html new file mode 100644 index 00000000..1c846cff --- /dev/null +++ b/templates/docs-landing.html @@ -0,0 +1,23 @@ +{% extends "left-aside.html" %} + +{% block subhead_content %} +
+

{{ page.title }}

+
+{% endblock subhead_content %} + +{% block main_content %} +
+{{ page.content | markdown | safe }} +
+{% endblock main_content %} + +{% block related_content %} +{% set nav_json %}{{< nav_merged extra={config.extra} />}}{% endset %} +{% set nav_data = load_data(literal=nav_json, format="json") %} +{% set nav_index_json %}{{< nav_command_index extra={config.extra} />}}{% endset %} +{% set nav_index = load_data(literal=nav_index_json, format="json") %} +{% set nav_map_json %}{{< nav_command_map nav={nav_data} index={nav_index} />}}{% endset %} +{% set nav_command_map = load_data(literal=nav_map_json, format="json") %} +{{< nav_menu nav={nav_data} extra={config.extra} command_map={nav_command_map} index={nav_index} on_overview={true} />}} +{% endblock related_content %} diff --git a/templates/macros/nav.html b/templates/macros/nav.html index fda70239..e2ff8488 100644 --- a/templates/macros/nav.html +++ b/templates/macros/nav.html @@ -309,7 +309,7 @@ {% endcomponent nav_command_reference %} {#- - The menu. + The menu. It starts with a link to the documentation overview, /docs/. current: slug of the current topic. related: key of the menu entry the current command belongs to (on command pages), see nav_command_map. @@ -322,10 +322,12 @@ index: from nav_command_index; used to list the command categories (groups) that have documented commands. on_command_reference: true on the command reference page. + on_overview: true on the documentation overview page. -#} -{% component nav_menu(nav, extra, current="", related="", open="", command_map={}, current_command="", index=[], on_command_reference=false) %} +{% component nav_menu(nav, extra, current="", related="", open="", command_map={}, current_command="", index=[], on_command_reference=false, on_overview=false) %}