From f070c63384402f5b01fc343b1af949ff9bfa047b Mon Sep 17 00:00:00 2001 From: Daniel Phillips Date: Fri, 4 Jul 2025 00:08:40 -0600 Subject: [PATCH 1/2] feat: Add breadcrumbs and enhance sidebar to commands page - Refactor the commands page to include breadcrumb navigation and sidebar. Signed-off-by: Daniel Phillips --- sass/_valkey.scss | 28 ++++++++++++++++ templates/command-page.html | 65 +++++++++++++++++++++++++++++++++---- templates/left-aside.html | 1 + 3 files changed, 88 insertions(+), 6 deletions(-) diff --git a/sass/_valkey.scss b/sass/_valkey.scss index a5cb189b..c16d7bf3 100644 --- a/sass/_valkey.scss +++ b/sass/_valkey.scss @@ -1871,3 +1871,31 @@ pre table { height: 18px; margin-right: 0.3rem; } + +.breadcrumbs { + border-radius: 20px; + background: #fff; + margin-bottom: 2rem; + + .breadcrumb-list { + display: flex; + align-self: center; + padding: 10px 20px; + list-style: none; + margin: 0; + gap: 5px; + + .breadcrumb-item { + align-items: center; + display: flex; + + img { + margin-right: 5px; + } + + .breadcrumb-link { + color: #2054B2; + } + } + } +} \ No newline at end of file diff --git a/templates/command-page.html b/templates/command-page.html index be3e02f2..ec4ea66f 100644 --- a/templates/command-page.html +++ b/templates/command-page.html @@ -1,4 +1,4 @@ -{% extends "right-aside.html" %} +{% extends "left-aside.html" %} {% import "macros/command.html" as commands %} @@ -34,9 +34,28 @@ {%- endblock -%} {% block subhead_content%} -{% if command_title%}

{{ command_title }} {% if deprecated %} {{ deprecated }}{% endif %}

{% endif %} + {% if command_title%} +
+

{{ command_title }} {% if deprecated %} {{ deprecated }}{% endif %}

+
+ {% endif %} {% endblock subhead_content%} +{% block breadcrumbs %} +{# Breadcrumbs section #} + +{% endblock breadcrumbs %} + {% block main_content %} {% if command_data_obj %}
@@ -205,8 +224,42 @@

History

{% endblock main_content %} {% block related_content %} -
- See an error? - Update this Page on GitHub! -
+{# Set up variables for sidebar, similar to commands.html #} +{% set_global group_descriptions = load_data(path= "../_data/groups.json", required= false) %} +{% set commands_entries = [] %} +{% set commands_section = get_section(path="commands/_index.md") %} +{% for page in commands_section.pages %} + {% for json_path in [ + commands::command_json_path(slug=page.slug), + commands::command_bloom_json_path(slug=page.slug), + commands::command_json_json_path(slug=page.slug), + commands::command_search_json_path(slug=page.slug) + ] %} + {% set command_data = load_data(path= json_path, required= false) %} + {% if command_data %} + {% set command_obj_name = commands::command_obj_name(command_data= command_data) %} + {% set command_data_obj = command_data[command_obj_name] %} + {% set command_display = command_obj_name %} + {% if command_data_obj.container %} + {% set command_display = command_data_obj.container ~ " " ~ command_display %} + {% endif %} + {% set command_entry = [ + command_display, + page.permalink | safe, + command_data_obj.summary, + command_data_obj.group + ] %} + {% set_global commands_entries = commands_entries | concat(with= [ command_entry ]) %} + {% endif %} + {% endfor %} +{% endfor %} +{% set_global grouped = commands_entries | sort(attribute="3") | group_by(attribute="3") %} + +

Alphabetical Command List

+
    +{% set alpha_entries = commands_entries | sort(attribute="0") %} +{% for entry in alpha_entries %} +
  • {{ entry[0] }}
  • +{% endfor %} +
{% endblock related_content %} diff --git a/templates/left-aside.html b/templates/left-aside.html index d3f6538e..c12f8feb 100644 --- a/templates/left-aside.html +++ b/templates/left-aside.html @@ -4,6 +4,7 @@ {% block subhead_content %}{% endblock subhead_content %}
+ {% block breadcrumbs %}{% endblock breadcrumbs %}
{% block main_content %}{% endblock main_content %}
From 137be2260ba361db6530bb5b65925d03118b3ae6 Mon Sep 17 00:00:00 2001 From: Daniel Phillips Date: Mon, 7 Jul 2025 17:55:48 -0600 Subject: [PATCH 2/2] feat(ui): enhance sidebar with search - Implement sidebar search functionality for commands - Add no results message for sidebar search Signed-off-by: Daniel Phillips --- sass/_valkey.scss | 26 +++++++++++++++++++++- templates/command-page.html | 44 ++++++++++++++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/sass/_valkey.scss b/sass/_valkey.scss index c16d7bf3..530a876c 100644 --- a/sass/_valkey.scss +++ b/sass/_valkey.scss @@ -640,6 +640,30 @@ p { } } +.sb-search-container { + display: flex; + align-items: center; + margin: 0 -2rem 2rem; + padding: 0 2rem 2rem; + border-bottom: 1px solid rgb(104, 147, 238); + + input { + flex: 1; + width: 100%; + min-width: 0px; + outline: none; + padding: 1.15rem; + border: 1px solid #ccc; + background: #fff; + border-radius: 50px; + font-size: 16px; + + &:focus { + border-color: #6983ff;; + } + } +} + .no-results-message { color: #30176e; padding: 5rem 2rem 7rem; @@ -1880,7 +1904,7 @@ pre table { .breadcrumb-list { display: flex; align-self: center; - padding: 10px 20px; + padding: 1rem 2rem; list-style: none; margin: 0; gap: 5px; diff --git a/templates/command-page.html b/templates/command-page.html index ec4ea66f..ba4e1a5a 100644 --- a/templates/command-page.html +++ b/templates/command-page.html @@ -255,11 +255,49 @@

History

{% endfor %} {% set_global grouped = commands_entries | sort(attribute="3") | group_by(attribute="3") %} -

Alphabetical Command List

-
    +
    + +
    + + + + +

    Alphabetical Command List

    +
      {% set alpha_entries = commands_entries | sort(attribute="0") %} {% for entry in alpha_entries %} -
    • {{ entry[0] }}
    • +
    • {{ entry[0] }}
    • {% endfor %}
    + + {% endblock related_content %}