From 04836804f2de8f017f5a9faf2fb798b4dda1b47a Mon Sep 17 00:00:00 2001 From: notleowang Date: Fri, 20 Nov 2026 15:40:01 -0700 Subject: [PATCH 1/6] Take search breadcrumbs for topics and commands from the docs menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Topic and command pages show breadcrumbs from the documentation menu (nav.yml) since #707, but search results gave them a breadcrumb made from the URL and the command's group, such as "Documentation › Command Reference › Server" for BGSAVE, whose page shows "Topics › Administration › Persistence". Both now come from the page's place in the menu, so a result's breadcrumb is the page's own without the page itself. Signed-off-by: notleowang --- templates/command-page.html | 17 +++++++++++------ templates/default.html | 5 +++-- templates/docs-page.html | 6 ++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/templates/command-page.html b/templates/command-page.html index e4df0554..3fa091bf 100644 --- a/templates/command-page.html +++ b/templates/command-page.html @@ -24,12 +24,6 @@ {% set command_title = command_obj_name %} {% endif %} {% set command_title = command_title | upper %} - {#- The command's group, for its breadcrumb in search results. #} - {% set command_groups = load_data(path="../_data/groups.json", required=false) %} - {% set command_group_key = command_data_obj.group | default(value="") | replace(from="_", to="-") %} - {% if command_groups and command_group_key in command_groups %} - {% set command_group = command_groups[command_group_key].display %} - {% endif %} {% if command_data_obj.deprecated_since and (command_title == "SLAVEOF" or command_title == "CLUSTER SLAVES") %} {% set deprecated = "Deprecated" %} {% endif %} @@ -46,6 +40,17 @@ {% set nav_location_json %}{{< nav_command_location nav={nav_data} name={command_title} container={command_container} group={command_data_obj.group} />}}{% endset %} {% set nav_location = load_data(literal=nav_location_json, format="json") %} {% endif %} + +{#- The breadcrumbs below without the command itself, for search results. #} +{% if nav_location and nav_location.section %} + {% set search_breadcrumb = "Topics › " ~ nav_location.title %} + {% if nav_location.topic and nav_location.topic != nav_location.landing %} + {% set nav_topic %}{{< nav_topic_title slug={nav_location.topic} extra={config.extra} />}}{% endset %} + {% set search_breadcrumb = search_breadcrumb ~ " › " ~ (nav_topic | trim) %} + {% endif %} +{% else %} + {% set search_breadcrumb = "Commands" %} +{% endif %} {%- endblock -%} {% block breadcrumbs %} diff --git a/templates/default.html b/templates/default.html index b440dd5b..e77bd294 100644 --- a/templates/default.html +++ b/templates/default.html @@ -8,10 +8,11 @@ {%- elif page is defined and page.title %}{% set page_name = page.title %} {%- elif section is defined and section.title %}{% set page_name = section.title %} {%- else %}{% set page_name = "" %}{% endif -%} -{#- Where the page sits in the site's navigation. #} +{#- Where the page sits in the site's navigation. Topic and command pages set search_breadcrumb from + the documentation menu in their head block, the same as their own breadcrumbs. #} {%- set path_segments = current_path | default(value="/") | split(pat="/") %} {%- set path_section = path_segments[1] | default(value="") %} -{%- if command_title is defined and command_title %}{% set breadcrumb = "Documentation › Command Reference" %}{% if command_group is defined and command_group %}{% set breadcrumb = breadcrumb ~ " › " ~ command_group %}{% endif %} +{%- if search_breadcrumb is defined and search_breadcrumb %}{% set breadcrumb = search_breadcrumb %} {%- elif path_section == "commands" %}{% set breadcrumb = "Documentation › Command Reference" %} {%- elif path_section == "topics" %}{% set breadcrumb = "Documentation › Documentation by Topic" %} {%- elif path_section == "clients" %}{% set breadcrumb = "Documentation › Clients" %} diff --git a/templates/docs-page.html b/templates/docs-page.html index 748c0c16..d8264a26 100644 --- a/templates/docs-page.html +++ b/templates/docs-page.html @@ -20,6 +20,12 @@ {% set nav_data = load_data(literal=nav_json, format="json") %} {% set nav_location_json %}{{< nav_topic_location nav={nav_data} slug={page.slug} />}}{% endset %} {% set nav_location = load_data(literal=nav_location_json, format="json") %} + +{#- The breadcrumbs below without the page itself, for search results. #} +{% set search_breadcrumb = "Topics" %} +{% if nav_location.section and nav_location.landing != page.slug %} + {% set search_breadcrumb = search_breadcrumb ~ " › " ~ nav_location.title %} +{% endif %} {%- endblock head -%} {% block breadcrumbs %} From be3e17925073ce75cedbd6d5185dfdb3691e0707 Mon Sep 17 00:00:00 2001 From: notleowang Date: Mon, 23 Nov 2026 13:13:58 -0700 Subject: [PATCH 2/6] Set search breadcrumbs in front matter instead of the template Breadcrumbs for pages other than topics and commands came from a list of URL paths and labels in default.html, so adding a section or changing a breadcrumb meant changing template logic. Each section now sets its breadcrumb with `breadcrumb` in its [extra] front matter, and a page uses its own, or else the one of its nearest section that sets one. Every page's breadcrumb is unchanged. Signed-off-by: notleowang --- content/authors/_index.md | 3 +++ content/blog/_index.md | 3 +++ content/clients/_index.md | 1 + content/commands/_index.md | 3 +++ content/community/_index.md | 1 + content/docs/index.md | 1 + content/download/index.md | 3 +++ content/download/releases/_index.md | 3 +++ content/download/versions/_index.md | 3 +++ content/events/_index.md | 3 +++ content/integrations/_index.md | 1 + content/participants.md | 2 ++ content/topics/_index.md | 3 +++ content/try-valkey/_index.md | 1 + templates/default.html | 33 +++++++++++++++-------------- 15 files changed, 48 insertions(+), 16 deletions(-) diff --git a/content/authors/_index.md b/content/authors/_index.md index 98eed54c..0c716b89 100644 --- a/content/authors/_index.md +++ b/content/authors/_index.md @@ -3,4 +3,7 @@ title = "Authors" template = "authors.html" page_template = "author-page.html" sort_by = "title" + +[extra] +breadcrumb = "Blog › Authors" +++ \ No newline at end of file diff --git a/content/blog/_index.md b/content/blog/_index.md index b09c166b..6bb60305 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -4,4 +4,7 @@ description = "Stay up to date with the latest news, tutorials, and updates from sort_by = "date" template = "blog.html" page_template = "blog-page.html" + +[extra] +breadcrumb = "Blog" +++ \ No newline at end of file diff --git a/content/clients/_index.md b/content/clients/_index.md index 59dd2f25..f5d12c21 100644 --- a/content/clients/_index.md +++ b/content/clients/_index.md @@ -4,5 +4,6 @@ template = "libraries.html" render = true [extra] +breadcrumb = "Documentation › Clients" kind = "clients" +++ diff --git a/content/commands/_index.md b/content/commands/_index.md index 873b371d..1b4870b5 100644 --- a/content/commands/_index.md +++ b/content/commands/_index.md @@ -5,4 +5,7 @@ page_template = "command-page.html" aliases= [ "/docs/topics/commands/" ] + +[extra] +breadcrumb = "Documentation › Command Reference" +++ \ No newline at end of file diff --git a/content/community/_index.md b/content/community/_index.md index 107f465e..9d9d2f11 100644 --- a/content/community/_index.md +++ b/content/community/_index.md @@ -4,6 +4,7 @@ description = "Join the Valkey community: contribute code, docs, and content, sp template = "community-home.html" page_template = "community.html" [extra] +breadcrumb = "Community" hero = { title = "Built by the community. For the community.", subtitle = "Every contributor started somewhere: a bug report, a talk, a line of code. This community is built one key at a time. Yours starts here.", image = "/img/community/hero-community.jpg" } connect = { title = "Connect with us", description = "Ask questions, share ideas, and meet the Valkey community.", links = [ diff --git a/content/docs/index.md b/content/docs/index.md index 2086a7b7..cf141ad4 100644 --- a/content/docs/index.md +++ b/content/docs/index.md @@ -3,6 +3,7 @@ title = "Documentation" template = "block-menu.html" page_template = "docs-page.html" [extra] +breadcrumb = "Documentation" body_class= "blocks-page" +++ diff --git a/content/download/index.md b/content/download/index.md index e3bebd7c..58699a27 100644 --- a/content/download/index.md +++ b/content/download/index.md @@ -1,6 +1,9 @@ +++ template = "download.html" title = "Download" + +[extra] +breadcrumb = "Download" +++ For installation instructions, supported package managers, and how to configure Valkey, see the diff --git a/content/download/releases/_index.md b/content/download/releases/_index.md index fa7457a1..3e387473 100644 --- a/content/download/releases/_index.md +++ b/content/download/releases/_index.md @@ -3,4 +3,7 @@ title = "Releases" page_template= "release-page.html" template= "release-section.html" sort_by= "title" + +[extra] +breadcrumb = "Download" +++ \ No newline at end of file diff --git a/content/download/versions/_index.md b/content/download/versions/_index.md index fc23cbbc..db131653 100644 --- a/content/download/versions/_index.md +++ b/content/download/versions/_index.md @@ -4,4 +4,7 @@ render = false page_template = "release-line.html" sort_by = "title" + +[extra] +breadcrumb = "Download" +++ diff --git a/content/events/_index.md b/content/events/_index.md index 4781a7c7..6be88410 100644 --- a/content/events/_index.md +++ b/content/events/_index.md @@ -4,4 +4,7 @@ template = "events.html" page_template = "event-page.html" sort_by = "date" generate_feeds = true + +[extra] +breadcrumb = "Community" +++ diff --git a/content/integrations/_index.md b/content/integrations/_index.md index fa722e51..bb86263c 100644 --- a/content/integrations/_index.md +++ b/content/integrations/_index.md @@ -4,5 +4,6 @@ template = "libraries.html" render = true [extra] +breadcrumb = "Documentation › Integrations" kind = "integrations" +++ diff --git a/content/participants.md b/content/participants.md index 3fa050db..19b25494 100644 --- a/content/participants.md +++ b/content/participants.md @@ -1,6 +1,8 @@ --- template: participants.html title: Participate with Valkey +extra: + breadcrumb: Participants --- # Valkey Participants diff --git a/content/topics/_index.md b/content/topics/_index.md index c759c280..2d235d51 100644 --- a/content/topics/_index.md +++ b/content/topics/_index.md @@ -3,4 +3,7 @@ title = "Topics" template = "docs.html" page_template = "docs-page.html" aliases = ["/docs/topics/"] + +[extra] +breadcrumb = "Documentation › Documentation by Topic" +++ diff --git a/content/try-valkey/_index.md b/content/try-valkey/_index.md index c3820f3c..71103532 100644 --- a/content/try-valkey/_index.md +++ b/content/try-valkey/_index.md @@ -2,6 +2,7 @@ title = "Try Valkey" template = "valkey-try-me.html" [extra] +breadcrumb = "Try Valkey" state_file = "https://download.valkey.io/try-me-valkey/9.1.4/states/state.bin.gz" filesystem_base_url = "https://download.valkey.io/try-me-valkey/9.1.4/fs/alpine-rootfs-flat" filesystem_base_fs = "https://download.valkey.io/try-me-valkey/9.1.4/fs/alpine-fs.json" diff --git a/templates/default.html b/templates/default.html index e77bd294..26190b44 100644 --- a/templates/default.html +++ b/templates/default.html @@ -8,23 +8,24 @@ {%- elif page is defined and page.title %}{% set page_name = page.title %} {%- elif section is defined and section.title %}{% set page_name = section.title %} {%- else %}{% set page_name = "" %}{% endif -%} -{#- Where the page sits in the site's navigation. Topic and command pages set search_breadcrumb from - the documentation menu in their head block, the same as their own breadcrumbs. #} -{%- set path_segments = current_path | default(value="/") | split(pat="/") %} -{%- set path_section = path_segments[1] | default(value="") %} +{#- Where the page sits in the site, shown with its search results. Topic and command pages set + search_breadcrumb from the documentation menu in their head block, the same as their own + breadcrumbs. Other pages use `breadcrumb` in the [extra] front matter of the page, or else of + its nearest section that sets one. #} +{%- set breadcrumb = "" %} {%- if search_breadcrumb is defined and search_breadcrumb %}{% set breadcrumb = search_breadcrumb %} -{%- elif path_section == "commands" %}{% set breadcrumb = "Documentation › Command Reference" %} -{%- elif path_section == "topics" %}{% set breadcrumb = "Documentation › Documentation by Topic" %} -{%- elif path_section == "clients" %}{% set breadcrumb = "Documentation › Clients" %} -{%- elif path_section == "integrations" %}{% set breadcrumb = "Documentation › Integrations" %} -{%- elif path_section == "docs" %}{% set breadcrumb = "Documentation" %} -{%- elif path_section == "blog" %}{% set breadcrumb = "Blog" %} -{%- elif path_section == "authors" %}{% set breadcrumb = "Blog › Authors" %} -{%- elif path_section == "download" %}{% set breadcrumb = "Download" %} -{%- elif path_section in ["community", "events"] %}{% set breadcrumb = "Community" %} -{%- elif path_section == "participants" %}{% set breadcrumb = "Participants" %} -{%- elif path_section == "try-valkey" %}{% set breadcrumb = "Try Valkey" %} -{%- else %}{% set breadcrumb = "" %}{% endif -%} +{%- else %} + {%- if page is defined %}{% set current = page %}{% elif section is defined %}{% set current = section %}{% else %}{% set current = {} %}{% endif %} + {%- if current %} + {%- set breadcrumb = current.extra?.breadcrumb | default(value="") %} + {%- for ancestor_path in current.ancestors | reverse %} + {%- if not breadcrumb %} + {%- set ancestor = get_section(path=ancestor_path, metadata_only=true) %} + {%- set_global breadcrumb = ancestor.extra?.breadcrumb | default(value="") %} + {%- endif %} + {%- endfor %} + {%- endif %} +{%- endif -%} {% include "includes/head.html" %} From 5c4907551c5376efddc3d6373a9cadd69a941650 Mon Sep 17 00:00:00 2001 From: notleowang Date: Mon, 23 Nov 2026 13:14:22 -0700 Subject: [PATCH 3/6] Name the topic and command indexes as the docs breadcrumbs do MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The topic and command pages' search breadcrumbs start with "Topics", or "Commands" for commands that aren't in the docs menu, but the indexes themselves had "Documentation › Documentation by Topic" and "Documentation › Command Reference". They now have "Topics" and "Commands". Signed-off-by: notleowang --- content/commands/_index.md | 2 +- content/topics/_index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/commands/_index.md b/content/commands/_index.md index 1b4870b5..0836dbeb 100644 --- a/content/commands/_index.md +++ b/content/commands/_index.md @@ -7,5 +7,5 @@ aliases= [ ] [extra] -breadcrumb = "Documentation › Command Reference" +breadcrumb = "Commands" +++ \ No newline at end of file diff --git a/content/topics/_index.md b/content/topics/_index.md index 2d235d51..3bb8f304 100644 --- a/content/topics/_index.md +++ b/content/topics/_index.md @@ -5,5 +5,5 @@ page_template = "docs-page.html" aliases = ["/docs/topics/"] [extra] -breadcrumb = "Documentation › Documentation by Topic" +breadcrumb = "Topics" +++ From 68e285f77284cd94c2c5fffb1f1cab21c6a947d8 Mon Sep 17 00:00:00 2001 From: notleowang Date: Mon, 23 Nov 2026 13:51:26 -0700 Subject: [PATCH 4/6] Fall back to the section title for search breadcrumbs The release automation (update-valkey-website.yml in valkey-io/valkey-release-automation) rewrites content/try-valkey/_index.md from a fixed template on every Valkey release, which would drop its `breadcrumb` and leave the Try Valkey pages without one. Pages with no `breadcrumb` in their own or their sections' front matter now use the title of their nearest section other than the site's root. Try Valkey's section title is its breadcrumb, so its `breadcrumb` is removed and the file is again exactly what the automation writes. The automation isn't changed. Every page's breadcrumb is unchanged. Signed-off-by: notleowang --- content/try-valkey/_index.md | 1 - templates/default.html | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/content/try-valkey/_index.md b/content/try-valkey/_index.md index 81c05f6f..8434353b 100644 --- a/content/try-valkey/_index.md +++ b/content/try-valkey/_index.md @@ -5,7 +5,6 @@ template = "valkey-try-me.html" state_file = "https://download.valkey.io/try-me-valkey/9.2.0/states/state.bin.gz" filesystem_base_url = "https://download.valkey.io/try-me-valkey/9.2.0/fs/alpine-rootfs-flat" filesystem_base_fs = "https://download.valkey.io/try-me-valkey/9.2.0/fs/alpine-fs.json" -breadcrumb = "Try Valkey" +++ diff --git a/templates/default.html b/templates/default.html index 26190b44..113d8567 100644 --- a/templates/default.html +++ b/templates/default.html @@ -11,7 +11,9 @@ {#- Where the page sits in the site, shown with its search results. Topic and command pages set search_breadcrumb from the documentation menu in their head block, the same as their own breadcrumbs. Other pages use `breadcrumb` in the [extra] front matter of the page, or else of - its nearest section that sets one. #} + its nearest section that sets one. Failing that, they use the title of their nearest section + other than the site's root, for sections whose _index.md is rewritten by tools that drop extra + keys, such as the release automation's rewrite of content/try-valkey/_index.md. #} {%- set breadcrumb = "" %} {%- if search_breadcrumb is defined and search_breadcrumb %}{% set breadcrumb = search_breadcrumb %} {%- else %} @@ -24,6 +26,18 @@ {%- set_global breadcrumb = ancestor.extra?.breadcrumb | default(value="") %} {%- endif %} {%- endfor %} + {%- if not breadcrumb %} + {%- if page is not defined and current.relative_path != "_index.md" %} + {%- set breadcrumb = current.title | default(value="") %} + {%- else %} + {%- for ancestor_path in current.ancestors | reverse %} + {%- if not breadcrumb and ancestor_path != "_index.md" %} + {%- set ancestor = get_section(path=ancestor_path, metadata_only=true) %} + {%- set_global breadcrumb = ancestor.title | default(value="") %} + {%- endif %} + {%- endfor %} + {%- endif %} + {%- endif %} {%- endif %} {%- endif -%} From c9e9d97ba80c73024db4d16448663d002ff00218 Mon Sep 17 00:00:00 2001 From: notleowang Date: Mon, 23 Nov 2026 14:32:32 -0700 Subject: [PATCH 5/6] Move the search modal's markup from search.js into a template The modal's contents and Pagefind's result template were HTML strings in search.js. They're now in templates/includes/search-modal.html, in a