From 20264277fab7d975125157aa4cc81ec36c0c3597 Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:17 +0000
Subject: [PATCH 1/8] Gather the docs from the repos in build/doc-sources.csv
build/doc-sources.csv lists the repos the command and topic pages come
from: valkey (core), the modules, valkey-bundle, and valkey-doc as the
fallback. build/checkout-doc-sources.sh clones them for CI, and
build/init-docs.sh replaces init-topics.sh and init-commands.sh: it
links docs/commands/*.md, docs/topics/* and src/commands/*.json from
every repo, and the fallback's commands/ and topics/ for names no code
repo provides, into build-command-docs/, build-topics/ and
build-command-json/. Two code repos providing the same name fail the
step. The menu comes from the core repo's docs/nav.yml and each other
repo's docs/nav.yml, else valkey-doc's nav.yml and modules-nav/.
groups.json comes from valkey docs/, else valkey-doc; modules.json stays
in valkey-doc.
The command JSON is in one directory, so the templates read one path,
and the menu takes its sources and "module" badges from the registry
instead of config.toml. Each stub records its source repo, branch and
path in [extra].
Adds valkey-ldap and valkey-bundle. valkey-search's docs/ copies of its
pages now win over valkey-doc's.
Signed-off-by: Madelyn Olson
---
.github/actions/build-site/action.yml | 57 +-----
.gitignore | 5 +-
build/checkout-doc-sources.sh | 19 ++
build/doc-sources.csv | 9 +
build/init-commands.sh | 139 -------------
build/init-docs.sh | 272 ++++++++++++++++++++++++++
build/init-topics.sh | 58 ------
config.toml | 29 +--
templates/command-page.html | 6 +-
templates/commands.html | 6 +-
templates/macros/nav.html | 22 ++-
11 files changed, 336 insertions(+), 286 deletions(-)
create mode 100755 build/checkout-doc-sources.sh
create mode 100644 build/doc-sources.csv
delete mode 100755 build/init-commands.sh
create mode 100755 build/init-docs.sh
delete mode 100755 build/init-topics.sh
diff --git a/.github/actions/build-site/action.yml b/.github/actions/build-site/action.yml
index afd65309..6f79f65c 100644
--- a/.github/actions/build-site/action.yml
+++ b/.github/actions/build-site/action.yml
@@ -1,8 +1,7 @@
name: Build the website
description: >
- Builds a checkout of this repository into /public, with its topics and
- commands from valkey-doc and the command metadata from valkey and the modules, checked out
- next to it in the workspace.
+ Builds a checkout of this repository into /public, with the commands and topics of
+ the repos in build/doc-sources.csv, checked out next to it in the workspace.
inputs:
path:
@@ -18,57 +17,17 @@ inputs:
runs:
using: composite
steps:
- - name: Checkout valkey
+ # Clones the repos in build/doc-sources.csv next to the website checkout.
+ - name: Checkout the doc sources
if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey
- path: valkey
-
- - name: Checkout valkey-bloom
- if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey-bloom
- path: valkey-bloom
-
- - name: Checkout valkey-doc
- if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey-doc
- path: valkey-doc
-
- - name: Checkout valkey-json
- if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey-json
- path: valkey-json
-
- - name: Checkout valkey-search
- if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey-search
- path: valkey-search
-
- - name: Checkout valkey-large-object
- if: inputs.checkout-content == 'true'
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- repository: valkey-io/valkey-large-object
- path: valkey-large-object
+ shell: bash
+ working-directory: ${{ inputs.path }}
+ run: ./build/checkout-doc-sources.sh ..
- name: Init commands and topics
shell: bash
working-directory: ${{ inputs.path }}
- run: |
- ./build/init-topics.sh ../valkey-doc/topics
- ./build/init-commands.sh ../valkey-doc/commands \
- ../valkey/src/commands ../valkey-bloom/src/commands \
- ../valkey-json/src/commands ../valkey-search/src/commands \
- ../valkey-large-object/src/commands
+ run: ./build/init-docs.sh ..
- name: Build only
uses: shalzz/zola-deploy-action@1be083648a1db2853ce4970e381740c0e2fd06de # v0.23.6
diff --git a/.gitignore b/.gitignore
index ff9171c0..7c9e7248 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,9 @@
.DS_Store
public
package-lock.json
-build-bloom-command-json
build-command-docs
build-command-json
-build-json-command-json
-build-search-command-json
-build-large-object-command-json
+build-nav
build-topics
content/commands/*
!content/commands/_index.md
diff --git a/build/checkout-doc-sources.sh b/build/checkout-doc-sources.sh
new file mode 100755
index 00000000..fe5b36c3
--- /dev/null
+++ b/build/checkout-doc-sources.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# See README for usage.
+# Clones every repo in build/doc-sources.csv into the directory given as the
+# first argument (default: the parent directory of this repo). Repos that are
+# already there are left alone.
+set -e
+
+registry="$(cd "$(dirname "$0")" && pwd)/doc-sources.csv"
+cd "${1:-$(dirname "$0")/../..}"
+
+tail -n +2 "$registry" | while IFS=, read -r name repository branch path role; do
+ [ -n "$name" ] || continue
+ if [ -e "$path" ]; then
+ echo "$name: $path exists, skipped"
+ continue
+ fi
+ git clone --quiet --depth 1 --branch "$branch" "https://github.com/$repository.git" "$path"
+ echo "$name: cloned $repository $branch into $path"
+done
diff --git a/build/doc-sources.csv b/build/doc-sources.csv
new file mode 100644
index 00000000..adf00a3e
--- /dev/null
+++ b/build/doc-sources.csv
@@ -0,0 +1,9 @@
+name,repository,branch,path,role
+valkey,valkey-io/valkey,unstable,valkey,core
+valkey-bloom,valkey-io/valkey-bloom,unstable,valkey-bloom,module
+valkey-json,valkey-io/valkey-json,unstable,valkey-json,module
+valkey-search,valkey-io/valkey-search,main,valkey-search,module
+valkey-ldap,valkey-io/valkey-ldap,main,valkey-ldap,module
+valkey-bundle,valkey-io/valkey-bundle,mainline,valkey-bundle,other
+valkey-large-object,valkey-io/valkey-large-object,main,valkey-large-object,module
+valkey-doc,valkey-io/valkey-doc,main,valkey-doc,fallback
diff --git a/build/init-commands.sh b/build/init-commands.sh
deleted file mode 100755
index f973c766..00000000
--- a/build/init-commands.sh
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/bin/bash
-# See README for usage
-# This file will create stub files for all the commands and create the correct symbolic links for the JSON files
-
-# first check to make sure there are arguments
-if [ -z "$1" ]; then
- echo "You must supply a path to the command docs as the first argument"
- exit 1
-fi
-
-if [ -z "$2" ]; then
- echo "You must supply a path to the command json as the second argument"
- exit 1
-fi
-
-# check for validity of these arguments as paths
-if [ ! -d "$1" ]; then
- echo "The command doc directory must exist and be a valid path"
- exit 1
-fi
-
-if [ ! -d "$2" ]; then
- echo "The command JSON directory must exist and be a valid path"
- exit 1
-fi
-
-if [ ! -d "$3" ]; then
- echo "The bloom module command JSON directory must exist and be a valid path"
- exit 1
-fi
-
-if [ ! -d "$4" ]; then
- echo "The JSON module command JSON directory must exist and be a valid path"
- exit 1
-fi
-
-if [ ! -d "$5" ]; then
- echo "The Search module command JSON directory must exist and be a valid path"
- exit 1
-fi
-
-if [ ! -d "$6" ]; then
- echo "The Large Object module command JSON directory must exist and be a valid path"
- exit 1
-fi
-
-# Uppercase aliases (/commands/GET/) collide with the lowercase pages
-# (/commands/get/) on case-insensitive filesystems (macOS default). Since
-# Zola 0.23, `zola build` may then write the alias redirect over the real
-# page, so skip the aliases there. Override with VALKEY_COMMAND_ALIASES=1
-# (always generate) or VALKEY_COMMAND_ALIASES=0 (never generate).
-if [ -n "$VALKEY_COMMAND_ALIASES" ]; then
- with_aliases=$VALKEY_COMMAND_ALIASES
-else
- probe=$(mktemp ./.case-probe-XXXXXX)
- if [ -e "$(tr '[:lower:]' '[:upper:]' <<< "$probe")" ]; then
- with_aliases=0
- echo "Case-insensitive filesystem detected: skipping uppercase command aliases."
- else
- with_aliases=1
- fi
- rm -f "$probe"
-fi
-
-ln -sfn $1 ./build-command-docs
-ln -sfn $2 ./build-command-json
-ln -sfn $3 ./build-bloom-command-json
-ln -sfn $4 ./build-json-command-json
-ln -sfn $5 ./build-search-command-json
-ln -sfn $6 ./build-large-object-command-json
-
-# The documentation menu needs each command's full name, container and group.
-# They're written to the stub files below (using jq), so that the templates
-# don't have to load every command's JSON file on every page. Without jq, the
-# templates read the JSON files instead, which makes the build slower.
-if command -v jq >/dev/null; then
- have_jq=1
-else
- have_jq=0
- echo "jq not found: the site will build correctly, but more slowly."
-fi
-
-for fname in $(find $1 -maxdepth 1 -iname "*.md")
-do
- base=${fname##*/}
- command=${base%.*}
- command_upper=$(awk '{ print toupper($0) }' <<< $command)
- if [[ "$command" != "index" ]]; then
- json_file=""
- if [ -f "$2/$command.json" ]; then
- metadata_path="/commands/$command.json in the 'valkey' repo"
- json_file="$2/$command.json"
- elif [ -f "$3/$command.json" ]; then
- metadata_path="/commands/$command.json in the 'valkey-bloom' repo"
- json_file="$3/$command.json"
- elif [ -f "$4/$command.json" ]; then
- metadata_path="/commands/$command.json in the 'valkey-json' repo"
- json_file="$4/$command.json"
- elif [ -f "$5/$command.json" ]; then
- metadata_path="/commands/$command.json in the 'valkey-search' repo"
- json_file="$5/$command.json"
- elif [ -f "$6/$command.json" ]; then
- metadata_path="/commands/$command.json in the 'valkey-large-object' repo"
- json_file="$6/$command.json"
- fi
- # TOML lines with the command's name, container and group, for the menu.
- menu_data=""
- if [ "$have_jq" = 1 ] && [ -n "$json_file" ]; then
- menu_fields=$(jq -r 'to_entries[0]
- | ((.value.container // "") | ascii_upcase) as $c
- | "command_name = \((($c + " " + .key) | ltrimstr(" ") | ascii_upcase) | @json)",
- "command_container = \($c | @json)",
- "command_group = \((.value.group // "") | @json)"' "$json_file")
- menu_data=$(printf '[extra]\n%s' "$menu_fields")
- fi
- if [ "$with_aliases" = 1 ]; then
- aliases_line="aliases = [\"/commands/$command_upper/\"]"
- else
- aliases_line="# Uppercase alias skipped, see build/init-commands.sh"
- fi
- cat << EOF > "./content/commands/$command.md"
-+++
-# This is a generated stub file.
-# To edit the command description see /commands/$command.md in the 'valkey-doc' repo
-# The command metadata is generated from $metadata_path
-$aliases_line
-$menu_data
-+++
-EOF
-fi
-done
-
-echo "Command stub files created."
-
-for datafile in groups.json resp2_replies.json resp3_replies.json modules.json; do
- ln -sf "../${1}/../${datafile}" "./_data/${datafile}"
-
- echo "Created link to ${datafile}"
-done
diff --git a/build/init-docs.sh b/build/init-docs.sh
new file mode 100755
index 00000000..11ebde5e
--- /dev/null
+++ b/build/init-docs.sh
@@ -0,0 +1,272 @@
+#!/bin/bash
+# See README for usage.
+# Gathers the command and topic docs from the repos listed in
+# build/doc-sources.csv, checked out under the directory given as the first
+# argument (default: the parent directory of this repo), and creates the stub
+# files that tell Zola to build a page for each command and topic.
+
+cd "$(dirname "$0")/.." || exit 1
+
+sources_arg=${1:-..}
+if [ ! -d "$sources_arg" ]; then
+ echo "The sources directory '$sources_arg' must exist and be a valid path"
+ exit 1
+fi
+sources=$(cd "$sources_arg" && pwd -P)
+# Links are relative when the argument is, so that they also work where the
+# workspace is mounted elsewhere (zola-deploy-action runs in a container). All
+# links are one directory deep.
+case "$sources_arg" in
+ /*) link_prefix=${sources_arg%/} ;;
+ *) link_prefix=../${sources_arg%/} ;;
+esac
+
+# ln -s for a file under $sources, from a link one directory deep.
+link_source() { #
+ ln -s "$link_prefix/${1#"$sources"/}" "$2"
+}
+
+# check for old style /docs/topics
+if [ -e "content/docs/topics" ]; then
+ echo "Documentation topic files have moved. Delete content/docs/topics before proceeding."
+ exit 1
+fi
+
+# The registry: one row per repo, in menu order. Arrays rather than an
+# associative array, for the bash 3.2 that ships with macOS.
+names=(); repositories=(); branches=(); paths=()
+core=""; fallback=""
+while IFS=, read -r name repository branch path role; do
+ [ -n "$name" ] || continue
+ i=${#names[@]}
+ names[i]=$name; repositories[i]=$repository; branches[i]=$branch; paths[i]=$path
+ case "$role" in
+ core) core=$i ;;
+ fallback) fallback=$i ;;
+ esac
+ if [ ! -d "$sources/$path" ]; then
+ echo "$name must be checked out at $sources/$path (see build/checkout-doc-sources.sh)"
+ exit 1
+ fi
+done < <(tail -n +2 build/doc-sources.csv)
+if [ -z "$core" ] || [ -z "$fallback" ]; then
+ echo "build/doc-sources.csv needs one repo with the role 'core' and one with the role 'fallback'"
+ exit 1
+fi
+
+duplicates=0
+
+# claim
+# Links the file into the build directory, unless a repo processed earlier
+# already provides that name: the fallback repo then loses silently, any other
+# repo is a duplicate. Sets `claimed` for the caller.
+claim() {
+ local target="$1/${2##*/}"
+ claimed=0
+ if [ -e "$target" ] || [ -L "$target" ]; then
+ if [ "$3" != "$fallback" ]; then
+ local first
+ first=$(readlink "$target") && first=${first#"$link_prefix"/} || first=$target
+ echo "Duplicate: ${2##*/} is provided by both $first and ${2#"$sources"/}"
+ duplicates=1
+ fi
+ return
+ fi
+ link_source "$2" "$target"
+ claimed=1
+}
+
+# Front matter lines that record where a page's source is, for the edit link.
+source_extra() {
+ printf '[extra]\nsource_repository = "%s"\nsource_branch = "%s"\nsource_path = "%s"\n' \
+ "${repositories[$1]}" "${branches[$1]}" "$2"
+}
+
+# Code repos first, then the fallback.
+order=()
+for i in "${!names[@]}"; do [ "$i" = "$fallback" ] || order+=("$i"); done
+order+=("$fallback")
+
+docs_dir() { #
+ if [ "$1" = "$fallback" ]; then echo "$2"; else echo "docs/$2"; fi
+}
+
+### Topics
+
+rm -rf build-topics
+mkdir build-topics
+
+write_topic_stub() { #
+ local stub="./content/topics/$1.md"
+ if [ -f "./build/custom-frontmatter/topics/$1.toml" ]; then
+ {
+ echo "+++"
+ cat "./build/custom-frontmatter/topics/$1.toml"
+ source_extra "$2" "$3"
+ echo "+++"
+ } > "$stub"
+ else
+ cat << EOF > "$stub"
++++
+# This is a generated stub file.
+# To edit the content see $3 in the '${names[$2]}' repo
+aliases = ["/docs/topics/$1/"]
+$(source_extra "$2" "$3")
++++
+EOF
+ fi
+}
+
+topic_from() { #
+ local base=${1##*/}
+ claim build-topics "$1" "$2"
+ if [ "$claimed" = 1 ] && [ "${base%.md}" != "$base" ] && [ "$base" != "index.md" ]; then
+ write_topic_stub "${base%.md}" "$2" "$3"
+ fi
+}
+
+for i in "${order[@]}"; do
+ dir=$(docs_dir "$i" topics)
+ for fname in "$sources/${paths[$i]}/$dir"/*; do
+ [ -f "$fname" ] && topic_from "$fname" "$i" "$dir/${fname##*/}"
+ done
+done
+
+echo "Topic stub files created at content/topics."
+
+for fname in build-topics/*; do
+ case "$(tr '[:upper:]' '[:lower:]' <<< "$fname")" in
+ *.png|*.jpg|*.jpeg|*.gif) cp "$fname" ./content/topics/ ;;
+ esac
+done
+echo "Copied images to topics directory."
+
+### Commands
+
+# Uppercase aliases (/commands/GET/) collide with the lowercase pages
+# (/commands/get/) on case-insensitive filesystems (macOS default). Since
+# Zola 0.23, `zola build` may then write the alias redirect over the real
+# page, so skip the aliases there. Override with VALKEY_COMMAND_ALIASES=1
+# (always generate) or VALKEY_COMMAND_ALIASES=0 (never generate).
+if [ -n "$VALKEY_COMMAND_ALIASES" ]; then
+ with_aliases=$VALKEY_COMMAND_ALIASES
+else
+ probe=$(mktemp ./.case-probe-XXXXXX)
+ if [ -e "$(tr '[:lower:]' '[:upper:]' <<< "$probe")" ]; then
+ with_aliases=0
+ echo "Case-insensitive filesystem detected: skipping uppercase command aliases."
+ else
+ with_aliases=1
+ fi
+ rm -f "$probe"
+fi
+
+# The command metadata (src/commands/*.json) of every repo but the fallback.
+rm -rf build-command-json
+mkdir build-command-json
+for i in "${order[@]}"; do
+ [ "$i" = "$fallback" ] && continue
+ for fname in "$sources/${paths[$i]}/src/commands"/*.json; do
+ [ -f "$fname" ] && claim build-command-json "$fname" "$i"
+ done
+done
+
+# The documentation menu needs each command's full name, container and group.
+# They're written to the stub files below (using jq), so that the templates
+# don't have to load every command's JSON file on every page. Without jq, the
+# templates read the JSON files instead, which makes the build slower.
+if command -v jq >/dev/null; then
+ have_jq=1
+else
+ have_jq=0
+ echo "jq not found: the site will build correctly, but more slowly."
+fi
+
+write_command_stub() { #
+ local command=$1 command_upper metadata_path="" json_file="" menu_fields="" j
+ command_upper=$(awk '{ print toupper($0) }' <<< "$command")
+ for j in "${order[@]}"; do
+ if [ "$j" != "$fallback" ] && [ -f "$sources/${paths[$j]}/src/commands/$command.json" ]; then
+ metadata_path="src/commands/$command.json in the '${names[$j]}' repo"
+ json_file="build-command-json/$command.json"
+ break
+ fi
+ done
+ # TOML lines with the command's name, container and group, for the menu.
+ if [ "$have_jq" = 1 ] && [ -n "$json_file" ]; then
+ menu_fields=$(jq -r 'to_entries[0]
+ | ((.value.container // "") | ascii_upcase) as $c
+ | "command_name = \((($c + " " + .key) | ltrimstr(" ") | ascii_upcase) | @json)",
+ "command_container = \($c | @json)",
+ "command_group = \((.value.group // "") | @json)"' "$json_file")
+ fi
+ if [ "$with_aliases" = 1 ]; then
+ aliases_line="aliases = [\"/commands/$command_upper/\"]"
+ else
+ aliases_line="# Uppercase alias skipped, see build/init-docs.sh"
+ fi
+ cat << EOF > "./content/commands/$command.md"
++++
+# This is a generated stub file.
+# To edit the command description see $3 in the '${names[$2]}' repo
+# The command metadata is generated from $metadata_path
+$aliases_line
+$(source_extra "$2" "$3")
+$menu_fields
++++
+EOF
+}
+
+rm -rf build-command-docs
+mkdir build-command-docs
+for i in "${order[@]}"; do
+ dir=$(docs_dir "$i" commands)
+ for fname in "$sources/${paths[$i]}/$dir"/*.md; do
+ [ -f "$fname" ] || continue
+ claim build-command-docs "$fname" "$i"
+ base=${fname##*/}
+ if [ "$claimed" = 1 ] && [ "$base" != "index.md" ]; then
+ write_command_stub "${base%.md}" "$i" "$dir/$base"
+ fi
+ done
+done
+
+echo "Command stub files created."
+
+if [ "$duplicates" = 1 ]; then
+ echo "Each command and topic must come from one repo. Remove the duplicates above."
+ exit 1
+fi
+
+### Menu and data files
+
+# link : links to the first candidate that exists.
+link_first() {
+ local link=$1 f
+ shift
+ rm -f "$link"
+ for f in "$@"; do
+ if [ -f "$f" ]; then
+ link_source "$f" "$link"
+ echo "Linked $link to ${f#"$sources"/}"
+ return
+ fi
+ done
+}
+
+fallback_dir="$sources/${paths[$fallback]}"
+core_dir="$sources/${paths[$core]}"
+
+rm -rf build-nav
+mkdir build-nav
+link_first build-nav/nav.yml "$core_dir/docs/nav.yml" "$fallback_dir/nav.yml"
+for i in "${!names[@]}"; do
+ if [ "$i" != "$core" ] && [ "$i" != "$fallback" ]; then
+ link_first "build-nav/${names[$i]}.yml" "$sources/${paths[$i]}/docs/nav.yml" "$fallback_dir/modules-nav/${names[$i]}.yml"
+ fi
+done
+
+link_first _data/groups.json "$core_dir/docs/groups.json" "$fallback_dir/groups.json"
+for datafile in modules.json resp2_replies.json resp3_replies.json; do
+ link_first "_data/$datafile" "$fallback_dir/$datafile"
+done
diff --git a/build/init-topics.sh b/build/init-topics.sh
deleted file mode 100755
index 2d1133b8..00000000
--- a/build/init-topics.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-# See README for usage
-# This file will create stub files for all the topics.
-
-# first check to make sure there are arguments
-if [ -z "$1" ]; then
- echo "You must supply a path to the topics as the first argument"
- exit 1
-fi
-
-# check for validity of the argument as a path
-if [ ! -d "$1" ]; then
- echo "The topics directory must exist and be a valid path"
- exit 1
-fi
-
-# check for old style /docs/topics
-if [ -e "content/docs/topics" ]; then
- echo "Documentation topic files have moved. Delete content/docs/topics before proceeding."
- exit 1
-fi
-
-# Create symlink to topics, except if it already exists and points to the same directory.
-if [ ! -L build-topics ] || [ "$(readlink build-topics)" != "$1" ]; then
- ln -sfn "$1" ./build-topics
-fi
-
-for fname in $(find $1 -maxdepth 1 -iname "*.md")
-do
- base=${fname##*/}
- topic=${base%.*}
-
- if [[ "$topic" != "index" ]]; then
- if [ -f "./build/custom-frontmatter/topics/$topic.toml" ]; then
- echo "+++" >> "./content/topics/$topic.md"
- cat "./build/custom-frontmatter/topics/$topic.toml" >> "./content/topics/$topic.md"
- echo "+++" >> "./content/topics/$topic.md"
- else
- cat << EOF > "./content/topics/$topic.md"
-+++
-# This is a generated stub file.
-# To edit the content see /topic/$topic.md in the 'valkey-doc' repo
-aliases = ["/docs/topics/$topic/"]
-+++
-EOF
-fi
-fi
-done
-
-echo "Topic stub files created at content/topics."
-
-for fname in $(find $1 -maxdepth 1 -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif")
-do
- base=${fname##*/}
- cp ${fname} ./content/topics/${base}
-done
-echo "Copied images to topics directory."
-
diff --git a/config.toml b/config.toml
index 98da73ff..b65e51d1 100644
--- a/config.toml
+++ b/config.toml
@@ -28,19 +28,17 @@ theme = "github-dark-default"
[extra]
command_description_path = "../build-command-docs/"
command_json_path = "../build-command-json/"
-command_bloom_json_path = "../build-bloom-command-json/"
-command_json_json_path = "../build-json-command-json/"
-command_search_json_path = "../build-search-command-json/"
-command_large_object_json_path = "../build-large-object-command-json/"
doc_topic_path = "../build-topics/"
-# Documentation menu. The core menu is nav.yml in the valkey docs, next to
-# the topics directory. Other sources, such as modules, can provide a menu
-# file that is merged into it, in the order listed here. Without nav.yml, the
-# menu only has the command reference.
-nav_path = "../build-topics/../nav.yml"
-nav_sources_path = "../build-topics/../modules-nav/"
-nav_sources = ["valkey-bloom", "valkey-json", "valkey-search", "valkey-ldap", "valkey-bundle", "valkey-large-object"]
+# The repos the docs come from (see README).
+doc_sources_path = "../build/doc-sources.csv"
+
+# Documentation menu, gathered by build/init-docs.sh. The core menu is the
+# core repo's nav.yml. The other repos can provide a menu file that is merged
+# into it, in the order of doc_sources_path. Without nav.yml, the menu only
+# has the command reference.
+nav_path = "../build-nav/nav.yml"
+nav_sources_path = "../build-nav/"
# Topics with known problems, shown with a "This page is under review" note.
review_list = [
@@ -65,12 +63,3 @@ in = "client-development"
title = "Valkey Admin"
url = "https://valkey-admin.valkey.io/"
in = "getting-started"
-
-# Labels shown next to menu entries from other sources, by source name. Only
-# modules get one; valkey-bundle isn't a module.
-[extra.nav_badges]
-"valkey-bloom" = "module"
-"valkey-json" = "module"
-"valkey-search" = "module"
-"valkey-ldap" = "module"
-"valkey-large-object" = "module"
diff --git a/templates/command-page.html b/templates/command-page.html
index 8b1ca83a..5d04accf 100644
--- a/templates/command-page.html
+++ b/templates/command-page.html
@@ -6,11 +6,7 @@
{% set command_description = load_data(path=config.extra.command_description_path ~ page.slug ~ ".md", required= false) %}
{% set command_sources = [
- load_data(path= config.extra.command_json_path ~ page.slug ~ ".json", required= false),
- load_data(path= config.extra.command_bloom_json_path ~ page.slug ~ ".json", required= false),
- load_data(path= config.extra.command_json_json_path ~ page.slug ~ ".json", required= false),
- load_data(path= config.extra.command_search_json_path ~ page.slug ~ ".json", required= false),
- load_data(path= config.extra.command_large_object_json_path ~ page.slug ~ ".json", required= false)
+ load_data(path= config.extra.command_json_path ~ page.slug ~ ".json", required= false)
] %}
{% set command_data = [s for s in command_sources if s] | first %}
diff --git a/templates/commands.html b/templates/commands.html
index 884fc391..6e5bb897 100644
--- a/templates/commands.html
+++ b/templates/commands.html
@@ -38,11 +38,7 @@
We couldn't find any results matching your search
{% for page in section.pages %}
{% for json_path in [
- config.extra.command_json_path ~ page.slug ~ ".json",
- config.extra.command_bloom_json_path ~ page.slug ~ ".json",
- config.extra.command_json_json_path ~ page.slug ~ ".json",
- config.extra.command_search_json_path ~ page.slug ~ ".json",
- config.extra.command_large_object_json_path ~ page.slug ~ ".json"
+ config.extra.command_json_path ~ page.slug ~ ".json"
] %}
{% set command_data = load_data(path= json_path, required= false) %}
{% if command_data %}
diff --git a/templates/macros/nav.html b/templates/macros/nav.html
index 69aa38b5..ad82b82f 100644
--- a/templates/macros/nav.html
+++ b/templates/macros/nav.html
@@ -5,7 +5,7 @@
The core menu defines the sections. A source's menu file can add topics to
a core section ("section: ") or add a new section ("id: ..."),
optionally placed after a core section ("after: "). The files are
- merged in the order given by config.extra.nav_sources.
+ merged in the order of the doc sources (build/doc-sources.csv).
The menu is lenient: it leaves out what doesn't fit instead of failing the
build. Topics that don't exist, entries for unknown sections, and
@@ -36,7 +36,8 @@
{#- Menu files of other sources that exist. Entries that refer to unknown sections are
never matched below, so they're left out. -#}
{%- set sources = [] -%}
- {%- for name in extra.nav_sources -%}
+ {%- set doc_sources = load_data(path=extra.doc_sources_path, format="csv") -%}
+ {%- for name in [r[0] for r in doc_sources.records if r[4] not in ["core", "fallback"]] -%}
{%- set entries = load_data(path=extra.nav_sources_path ~ name ~ ".yml", format="yaml", required=false) -%}
{%- if entries -%}
{%- set_global sources = [...sources, {"name": name, "entries": entries}] -%}
@@ -132,7 +133,7 @@
All commands that have a page, as a JSON list of
{"name": "CONFIG GET", "container": "CONFIG", "group": "server", "slug": "config-get"}.
The data comes from the command pages' front matter, written by
- build/init-commands.sh from the command JSON files. For pages without it
+ build/init-docs.sh from the command JSON files. For pages without it
(no jq, or stubs from an older init run), the command JSON file is read
instead: same result, slower build.
-#}
@@ -143,7 +144,7 @@
{%- if page.extra?.command_name -%}
{%- set_global index = [...index, {"name": page.extra.command_name, "container": page.extra.command_container, "group": page.extra.command_group, "slug": page.slug}] -%}
{%- else -%}
- {%- for json_path in [extra.command_json_path, extra.command_bloom_json_path, extra.command_json_json_path, extra.command_search_json_path, extra.command_large_object_json_path] -%}
+ {%- for json_path in [extra.command_json_path] -%}
{%- set data = load_data(path=json_path ~ page.slug ~ ".json", required=false) -%}
{%- if data -%}
{%- set key = data | keys | first -%}
@@ -262,6 +263,15 @@
{%- endif %}
{% endcomponent nav_pager %}
+{#- The label shown next to a doc source's menu entries: "module" for the
+ repos with the role "module" in build/doc-sources.csv, otherwise none. -#}
+{% component nav_badge(source, extra) %}
+{%- set doc_sources = load_data(path=extra.doc_sources_path, format="csv") -%}
+{%- for r in doc_sources.records -%}
+ {%- if r[0] == source and r[4] == "module" -%}module{%- endif -%}
+{%- endfor -%}
+{% endcomponent nav_badge %}
+
{#- A topic's title: `title` if set, otherwise the title in the topic's front matter. -#}
{% component nav_topic_title(slug, extra, title="") %}
{%- if title -%}{{ title }}{%- else -%}
@@ -284,7 +294,7 @@
row is the toggle for its commands instead.
-#}
{% component nav_menu_item(slug, title, source, current, related, extra, commands=[], current_command="", label="") %}
-{%- set badge = extra.nav_badges[source] | default(value="") -%}
+{%- set badge %}{{< nav_badge source={source} extra={extra} />}}{% endset -%}
{%- if commands and slug == current %}
{%- if section.landing %}
From a60255f4b3425762c522056778d59045495a5e4d Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:51 +0000
Subject: [PATCH 2/8] Point "Update this Page on GitHub" at the page's source
The edit links were hard-coded to valkey-doc. They now use the source
repo, branch and path that build/init-docs.sh records in each stub.
Signed-off-by: Madelyn Olson
---
templates/command-page.html | 4 ++--
templates/docs-page.html | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/templates/command-page.html b/templates/command-page.html
index 5d04accf..9c16b422 100644
--- a/templates/command-page.html
+++ b/templates/command-page.html
@@ -222,10 +222,10 @@
RESP3 Reply
{% endif %}
-{# Every command page, module commands included, is built from a description in valkey-doc (see build/init-commands.sh). #}
+{# The stub's front matter says where the description comes from (see build/init-docs.sh). #}
{{< nav_pager nav={nav_data} slug={page.slug} extra={config.extra} />}}
{% endblock main_content %}
From a5e5df44ebaa2ab0774ce264af21c65e0c6d1ffd Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:51 +0000
Subject: [PATCH 3/8] Generate the module API reference from valkey
src/module.c
build/init-docs.sh runs valkey's utils/generate-module-api-doc.rb and
uses its output for /topics/modules-api-ref/ instead of valkey-doc's
committed copy, which goes stale between regenerations. The script
needs Ruby >= 2.3; without it the fallback's copy is used, with a
warning.
"Available since" comes from valkey's release tags, so
checkout-doc-sources.sh fetches every tag at depth 1. That gives the
same output as a full clone (16 MB instead of 305 MB of .git).
Signed-off-by: Madelyn Olson
---
build/checkout-doc-sources.sh | 5 +++++
build/init-docs.sh | 23 +++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/build/checkout-doc-sources.sh b/build/checkout-doc-sources.sh
index fe5b36c3..7aa4e7f6 100755
--- a/build/checkout-doc-sources.sh
+++ b/build/checkout-doc-sources.sh
@@ -15,5 +15,10 @@ tail -n +2 "$registry" | while IFS=, read -r name repository branch path role; d
continue
fi
git clone --quiet --depth 1 --branch "$branch" "https://github.com/$repository.git" "$path"
+ # The core repo's release tags fill in "Available since" in the
+ # generated module API reference. Each tag needs only its own commit.
+ if [ "$role" = core ]; then
+ git -C "$path" fetch --quiet --depth 1 origin '+refs/tags/*:refs/tags/*'
+ fi
echo "$name: cloned $repository $branch into $path"
done
diff --git a/build/init-docs.sh b/build/init-docs.sh
index 11ebde5e..2cbaf6a3 100755
--- a/build/init-docs.sh
+++ b/build/init-docs.sh
@@ -125,7 +125,30 @@ topic_from() { #
fi
}
+# The module API reference is generated from the core repo's src/module.c.
+# It needs Ruby >= 2.3, and the core repo's git tags for "Available since".
+generate_api_ref() {
+ local valkey="$sources/${paths[$core]}"
+ if ! [ -f "$valkey/utils/generate-module-api-doc.rb" ]; then
+ echo "Warning: $valkey/utils/generate-module-api-doc.rb not found: modules-api-ref.md is not generated, the fallback repo's copy is used if it has one."
+ return 1
+ fi
+ if ! ruby -e 'exit(Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.3"))' 2>/dev/null; then
+ echo "Warning: Ruby >= 2.3 not found: modules-api-ref.md is not generated, the fallback repo's copy is used if it has one."
+ return 1
+ fi
+ if ! (cd "$valkey" && ruby utils/generate-module-api-doc.rb) > build-topics/modules-api-ref.md; then
+ echo "Warning: utils/generate-module-api-doc.rb failed: the fallback repo's modules-api-ref.md is used if it has one."
+ rm -f build-topics/modules-api-ref.md
+ return 1
+ fi
+ echo "Generated modules-api-ref.md from ${names[$core]} src/module.c."
+}
+
for i in "${order[@]}"; do
+ if [ "$i" = "$fallback" ] && [ ! -e build-topics/modules-api-ref.md ] && generate_api_ref; then
+ write_topic_stub modules-api-ref "$core" src/module.c
+ fi
dir=$(docs_dir "$i" topics)
for fname in "$sources/${paths[$i]}/$dir"/*; do
[ -f "$fname" ] && topic_from "$fname" "$i" "$dir/${fname##*/}"
From ae69543dfcc835ee21a9a903116dc719dd395024 Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:51 +0000
Subject: [PATCH 4/8] Fix command page links when a line has two topic links
The ../topics/.md patterns in fix_links_command matched from the
first link on a line to the .md of the next one, so valkey-search's
ft.search.md, which has both links to search-query.md on one line,
rendered /commands/topics/search-query#vector-range-match and
/topics/search-query.md. Stop the file name at a closing parenthesis.
No valkey-doc page changes.
Signed-off-by: Madelyn Olson
---
templates/macros/command.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/macros/command.html b/templates/macros/command.html
index 86947090..2604d2c2 100644
--- a/templates/macros/command.html
+++ b/templates/macros/command.html
@@ -46,8 +46,8 @@
{% component fix_links_command(content) %}
{{ content
- | regex_replace(pattern="\\]\\(\\.\\./topics/(?P.*?).md#(?P.*?)\\)", rep="](/topics/$fname#$hash)")
- | regex_replace(pattern="\\]\\(\\.\\./topics/(?P.*?).md\\)", rep="](/topics/$fname)")
+ | regex_replace(pattern="\\]\\(\\.\\./topics/(?P[^)]*?).md#(?P.*?)\\)", rep="](/topics/$fname#$hash)")
+ | regex_replace(pattern="\\]\\(\\.\\./topics/(?P[^)]*?).md\\)", rep="](/topics/$fname)")
| regex_replace(pattern="\\[(?P.*?)\\]:\\s+\\.\\./topics/(?P.*?).md", rep="[$token]: /topics/$fname")
| regex_replace(pattern="\\]\\((?P[\\w\\.-]*?)\\.md#(?P.*?)\\)", rep="](/commands/$fname#$hash)")
| regex_replace(pattern="\\]\\((?P[\\w\\.-]*?)\\.md\\)", rep="](/commands/$fname)")
From 1035967a4c46c58af922dd052b7b247fdc549a50 Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:51 +0000
Subject: [PATCH 5/8] Point links from docs/ to the rest of a repo at GitHub
valkey-search's docs link to ../../COMPATIBILITY.md, which isn't a page
on the site. A ../../ link in a page from docs/commands/ or docs/topics/
now goes to that file in the page's repo on GitHub, which is what
valkey-doc's copies of those pages link to.
Signed-off-by: Madelyn Olson
---
templates/command-page.html | 2 +-
templates/docs-page.html | 2 +-
templates/macros/command.html | 4 +++-
templates/macros/docs.html | 4 +++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/templates/command-page.html b/templates/command-page.html
index 9c16b422..1366f81d 100644
--- a/templates/command-page.html
+++ b/templates/command-page.html
@@ -161,7 +161,7 @@
diff --git a/templates/macros/command.html b/templates/macros/command.html
index 2604d2c2..8d408a22 100644
--- a/templates/macros/command.html
+++ b/templates/macros/command.html
@@ -44,7 +44,9 @@
{%- endfor -%}
{% endcomponent arguments_parse %}
-{% component fix_links_command(content) %}
+{# repo_url: links from docs/commands/ or docs/topics/ to elsewhere in the
+ page's repo (../../COMPATIBILITY.md) go to that file on GitHub. #}
+{% component fix_links_command(content, repo_url="") %}{% if repo_url %}{% set content = content | regex_replace(pattern="\\]\\(\\.\\./\\.\\./(?P[^)]*)\\)", rep="](" ~ repo_url ~ "$path)") %}{% endif %}
{{ content
| regex_replace(pattern="\\]\\(\\.\\./topics/(?P[^)]*?).md#(?P.*?)\\)", rep="](/topics/$fname#$hash)")
| regex_replace(pattern="\\]\\(\\.\\./topics/(?P[^)]*?).md\\)", rep="](/topics/$fname)")
diff --git a/templates/macros/docs.html b/templates/macros/docs.html
index 5d1101e9..560a14b0 100644
--- a/templates/macros/docs.html
+++ b/templates/macros/docs.html
@@ -26,7 +26,9 @@
{{ parts[2:] | join(sep="---") | safe }}
{% endcomponent extract_markdown %}
-{% component fix_links_docs(content) %}
+{# repo_url: links from docs/commands/ or docs/topics/ to elsewhere in the
+ page's repo (../../COMPATIBILITY.md) go to that file on GitHub. #}
+{% component fix_links_docs(content, repo_url="") %}{% if repo_url %}{% set content = content | regex_replace(pattern="\\]\\(\\.\\./\\.\\./(?P[^)]*)\\)", rep="](" ~ repo_url ~ "$path)") %}{% endif %}
{{ content
| regex_replace(pattern="\\]\\(#(?P.*?\\))", rep="](--$hash")
| regex_replace(pattern="\\]\\((?Phttpsd?:\\/\\/.*?\\))", rep="](-$url")
From 6b213cc0243de3537201372011502b75bbbbcc8d Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:07:51 +0000
Subject: [PATCH 6/8] Document where the docs come from
README: how to check out and gather the docs, the file layout, the
precedence and duplicate rules, and how to register a repo. The
community page points contributors at the docs next to the code instead
of valkey-doc.
Signed-off-by: Madelyn Olson
---
README.md | 94 +++++++++++++++----------------------
content/community/_index.md | 4 +-
2 files changed, 40 insertions(+), 58 deletions(-)
diff --git a/README.md b/README.md
index cdc2ec3a..cfc08e33 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Valkey.io website
This repo contains the source for the valkey.io website (build scripts, template, blog posts, stylesheets, etc.).
-The build integrates content from [`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) and the commands definitions from [`valkey-io/valkey`](https://github.com/valkey-io/valkey), [`valkey-io/valkey-bloom`](https://github.com/valkey-io/valkey-bloom), and [`valkey-io/valkey-json`](https://github.com/valkey-io/valkey-json) (see [Build Locally](#build-locally) below for more details)
+The build integrates the command and topic docs from [`valkey-io/valkey`](https://github.com/valkey-io/valkey) and the module repos, with [`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) as the fallback (see [Building additional content](#building-additional-content) below).
## Contributing
@@ -43,79 +43,61 @@ The script downloads the SPDX license list, so it needs network access.
## Building additional content
**By default, the site will build without documentation topics or the command reference.**
-The content for documentation topics is stored within the `valkey-io/valkey-doc` repo.
-The content for the command reference page is in the `valkey-io/valkey` repo.
+The command and topic pages live next to the code: valkey's in [`valkey-io/valkey`](https://github.com/valkey-io/valkey), each module's in its own repo.
+[`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) is the fallback for pages that haven't moved yet, and still holds `modules.json`.
The clients and integrations pages (`/clients/`, `/integrations/`) are built from `_data/libraries/` in this repo, so they need no other repo.
-If you want to build the site with this content, you'll need to have a local copy of `valkey-io/valkey-doc` and `valkey-io/valkey` _outside_ of this repo.
-Then follow the instructions to [build the documentation topics](#building-the-documentation-topics) and/or [build the command reference](#building-the-command-reference).
-The instructions show how to use scripts that create symbolic links to the `valkey-io/valkey-doc` and `valkey-io/valkey` repos as well as create a series of empty stub files that tell Zola to create pages.
+To build the site with the docs, check out the repos listed in `build/doc-sources.csv` next to this repo, then gather their docs:
-### Building the documentation topics
-
-Documentation 'topics' (i.e. `/topics/keyspace/`, `/topics/encryption/`, `/topics/transactions/`) source content from `valkey-io/valkey-doc`.
-
-```mermaid
-flowchart TD
- A[Webpage: /topics/keyspace/ ]
- A --> B[Template: valkey-io/valkey-website]
- B --> H[Repo: valkey-io/valkey-doc ] --> I[File: /topics/keyspace.md ] --> Y[Topic content]
+```shell
+# Clones the repos that aren't there yet (shallow, so it's quick).
+./build/checkout-doc-sources.sh ..
+# Run again when you add or remove a command or topic, or change a command's group or container.
+./build/init-docs.sh ..
```
-Let's say that this repo and your local copy of `valkey-io/valkey-doc` reside in the same directory.
-First, stop the `zola serve` process if you're running it.
-From the root directory of this repo run:
+Then restart `zola serve`.
+`init-docs.sh` links the docs into `build-*` directories and writes a stub file in `content/commands/` or `content/topics/` for each page; all of them are ignored by git.
+Edit the pages in their own repos; every page links to its source with "Update this Page on GitHub!".
+The script uses [jq](https://jqlang.org/), if installed, to store each command's group and container for the documentation menu; without it the site still builds, but more slowly.
-```shell
-# You should only need to run this once or when you add a new topic.
-./build/init-topics.sh ../valkey-doc/topics
-```
+### Where the docs come from
-Then, restart Zola.
-Point your browser at `http://127.0.0.1:1111/topics/` and you should see the fully populated list of topics.
-All files created in this process are ignored by git.
-Commit your changes to your local copy of `valkey-io/valkey-doc`.
+Each repo in `build/doc-sources.csv` can provide:
-### Building the command reference
+| File | Page |
+|---|---|
+| `docs/commands/.md` | `/commands//`, with the metadata from `src/commands/.json` |
+| `docs/topics/.md`, and images next to it | `/topics//` |
+| `docs/nav.yml` | Its entries in the documentation menu |
+| `docs/groups.json` (core repo only) | The command groups |
-The command reference (i.e. `/commands/set/`, `/commands/get/`, `/commands/lolwut/`) sources information from `valkey-io/valkey`, `valkey-io/valkey-bloom`, and `valkey-io/valkey-doc`.
-`valkey-io/valkey`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, `valkey-io/valkey-search` and `valkey-io/valkey-large-object` provides the command metadata (items like computational complexity, version history, arguments, etc)
-whilst `valkey-io/valkey-doc` provides the command description and the command reply.
+`src/commands/.json` is the command's metadata (arguments, complexity, history); it gets a page only if some repo has `docs/commands/.md`.
+The fallback repo (valkey-doc) has the same files without the `docs/` prefix, its menu files in `nav.yml` and `modules-nav/.yml`.
+A code repo's file wins over the fallback's copy with the same name.
+If two code repos provide the same command, topic, image or command JSON, `init-docs.sh` lists both paths and fails, so a URL can't silently change source.
+The menu merges the core repo's `nav.yml` with the other repos' menu files, in the order of `build/doc-sources.csv`.
-```mermaid
-flowchart TD
- A[Webpage: valkey.io/commands/set]
- A --> B[Template: valkey-io/valkey-website]
- B --> F[Repo: valkey-io/valkey ] --> G[File: /src/commands/set.json ] --> X[Command Metadata]
- B --> H[Repo: valkey-io/valkey-doc ] --> I[File: /commands/set.md ] --> Y[Command Description]
- H --> J[Files: /resp2_replies.json, /resp3_replies.json] --> Z[Command Reply]
-```
+`/topics/modules-api-ref/` is generated from valkey's `src/module.c` with `utils/generate-module-api-doc.rb`, which needs Ruby 2.3 or later and valkey's release tags (`checkout-doc-sources.sh` fetches them).
+Without Ruby, the fallback's copy is used if it has one.
-Let's say that this repo and your local copy of `valkey-io/valkey-doc`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, `valkey-io/valkey-search`,
-`valkey-io/valkey-large-object` and `valkey-io/valkey` reside in the same directories.
+### Adding a repo
-First, stop the `zola serve` process if you're running it.
-From the root directory of this repo run:
+Add a row to `build/doc-sources.csv`; nothing else in this repo needs to change.
-```shell
-# You should only need to run this once or when you add a new command,
-# or when a command's group or container changes.
-./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands \
- ../valkey-bloom/src/commands ../valkey-json/src/commands ../valkey-search/src/commands \
- ../valkey-large-object/src/commands
+```csv
+name,repository,branch,path,role
+valkey-bloom,valkey-io/valkey-bloom,unstable,valkey-bloom,module
```
-The script uses [jq](https://jqlang.org/), if installed, to store each command's group and container for the documentation menu.
-Without jq, the site still builds correctly, but more slowly.
-
-Then, restart Zola.
-Point your browser at `http://127.0.0.1:1111/commands/` and you should see the fully populated list of topics.
-All files created in this process are ignored by git.
-Commit your changes to your local copy of `valkey-io/valkey-doc` for description changes and `valkey-io/valkey` for command JSON changes (if you have any).
+- `name`: the repo's name in the menu data and the stub comments, and the name of its fallback menu file (`modules-nav/.yml`).
+- `repository` and `branch`: what CI checks out, and where "Update this Page on GitHub!" points. To build against a fork's branch, change these two.
+- `path`: the checkout directory, relative to the directory that holds this repo.
+- `role`: `core` (valkey: the core menu and `groups.json`), `fallback` (valkey-doc), `module` (its menu entries get a "module" label), or `other`.
### Checking links
-Pull requests and deploys check the built site for links to missing pages or `#anchors`, and for valkey-doc links that weren't converted to site URLs.
+Pull requests and deploys check the built site for links to missing pages or `#anchors`, and for doc links that weren't converted to site URLs.
To run the checks locally (needs [lychee](https://lychee.cli.rs/) and jq), set up the topics and commands as above, then:
```shell
diff --git a/content/community/_index.md b/content/community/_index.md
index 107f465e..db76f2b1 100644
--- a/content/community/_index.md
+++ b/content/community/_index.md
@@ -38,8 +38,8 @@ cards = [
{ url = "https://github.com/valkey-io/valkey/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=%5BBUG%5D", text = "Report a Bug" },
{ url = "https://github.com/valkey-io/valkey/blob/unstable/SECURITY.md", text = "Security Policy" }
] },
- { icon = "icon-book.svg", title = "Contribute to Documentation", description = "Help make Valkey easier to learn and use. Documentation content, tutorials, and topic guides live in the valkey-doc repository and welcome pull requests.", links = [
- { url = "https://github.com/valkey-io/valkey-doc", text = "valkey-doc Repository" }
+ { icon = "icon-book.svg", title = "Contribute to Documentation", description = "Help make Valkey easier to learn and use. Command pages and topic guides live next to the code, in valkey and in each module's repository, and welcome pull requests. Every page links to its source.", links = [
+ { url = "https://github.com/valkey-io/valkey/tree/unstable/docs", text = "Valkey Documentation Source" }
] },
{ icon = "icon-bulb.svg", title = "Feature Requests", description = "We value your ideas! If you have a suggestion for a new feature, submit a feature request on GitHub and help shape the roadmap.", links = [
{ url = "https://github.com/valkey-io/valkey/issues/new?assignees=&labels=&projects=&template=feature_request.md&title=%5BNEW%5D", text = "Submit a Feature Request" }
From 6316ef8c1c2b960dddc5a3f1b94ee7632aa3bbb1 Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:25:52 +0000
Subject: [PATCH 7/8] Replace build/doc-sources.csv with build/doc-sources.toml
One [[source]] table per repo, in the same order, with a comment block
that explains the keys and roles and how to add a module. The shell
scripts read it through build/doc-sources.py (stdlib tomllib, Python
3.11+), which also checks for unknown roles, missing keys and exactly
one core and one fallback repo. The templates load it as TOML.
The built site is identical.
Signed-off-by: Madelyn Olson
---
.github/actions/build-site/action.yml | 4 +-
README.md | 18 +++---
build/checkout-doc-sources.sh | 9 ++-
build/doc-sources.csv | 9 ---
build/doc-sources.py | 51 +++++++++++++++
build/doc-sources.toml | 90 +++++++++++++++++++++++++++
build/init-docs.sh | 15 ++---
config.toml | 2 +-
templates/macros/nav.html | 14 ++---
9 files changed, 172 insertions(+), 40 deletions(-)
delete mode 100644 build/doc-sources.csv
create mode 100755 build/doc-sources.py
create mode 100644 build/doc-sources.toml
diff --git a/.github/actions/build-site/action.yml b/.github/actions/build-site/action.yml
index 6f79f65c..fa790568 100644
--- a/.github/actions/build-site/action.yml
+++ b/.github/actions/build-site/action.yml
@@ -1,7 +1,7 @@
name: Build the website
description: >
Builds a checkout of this repository into /public, with the commands and topics of
- the repos in build/doc-sources.csv, checked out next to it in the workspace.
+ the repos in build/doc-sources.toml, checked out next to it in the workspace.
inputs:
path:
@@ -17,7 +17,7 @@ inputs:
runs:
using: composite
steps:
- # Clones the repos in build/doc-sources.csv next to the website checkout.
+ # Clones the repos in build/doc-sources.toml next to the website checkout.
- name: Checkout the doc sources
if: inputs.checkout-content == 'true'
shell: bash
diff --git a/README.md b/README.md
index cfc08e33..a41ac564 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ The command and topic pages live next to the code: valkey's in [`valkey-io/valke
[`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) is the fallback for pages that haven't moved yet, and still holds `modules.json`.
The clients and integrations pages (`/clients/`, `/integrations/`) are built from `_data/libraries/` in this repo, so they need no other repo.
-To build the site with the docs, check out the repos listed in `build/doc-sources.csv` next to this repo, then gather their docs:
+To build the site with the docs, check out the repos listed in `build/doc-sources.toml` next to this repo, then gather their docs (the scripts need Python 3.11 or later to read the TOML file):
```shell
# Clones the repos that aren't there yet (shallow, so it's quick).
@@ -63,7 +63,7 @@ The script uses [jq](https://jqlang.org/), if installed, to store each command's
### Where the docs come from
-Each repo in `build/doc-sources.csv` can provide:
+Each repo in `build/doc-sources.toml` can provide:
| File | Page |
|---|---|
@@ -76,18 +76,22 @@ Each repo in `build/doc-sources.csv` can provide:
The fallback repo (valkey-doc) has the same files without the `docs/` prefix, its menu files in `nav.yml` and `modules-nav/.yml`.
A code repo's file wins over the fallback's copy with the same name.
If two code repos provide the same command, topic, image or command JSON, `init-docs.sh` lists both paths and fails, so a URL can't silently change source.
-The menu merges the core repo's `nav.yml` with the other repos' menu files, in the order of `build/doc-sources.csv`.
+The menu merges the core repo's `nav.yml` with the other repos' menu files, in the order of `build/doc-sources.toml`.
`/topics/modules-api-ref/` is generated from valkey's `src/module.c` with `utils/generate-module-api-doc.rb`, which needs Ruby 2.3 or later and valkey's release tags (`checkout-doc-sources.sh` fetches them).
Without Ruby, the fallback's copy is used if it has one.
### Adding a repo
-Add a row to `build/doc-sources.csv`; nothing else in this repo needs to change.
+Add a `[[source]]` table to `build/doc-sources.toml`; nothing else in this repo needs to change.
-```csv
-name,repository,branch,path,role
-valkey-bloom,valkey-io/valkey-bloom,unstable,valkey-bloom,module
+```toml
+[[source]]
+name = "valkey-bloom"
+repository = "valkey-io/valkey-bloom"
+branch = "unstable"
+path = "valkey-bloom"
+role = "module"
```
- `name`: the repo's name in the menu data and the stub comments, and the name of its fallback menu file (`modules-nav/.yml`).
diff --git a/build/checkout-doc-sources.sh b/build/checkout-doc-sources.sh
index 7aa4e7f6..9a3d25db 100755
--- a/build/checkout-doc-sources.sh
+++ b/build/checkout-doc-sources.sh
@@ -1,15 +1,14 @@
#!/bin/bash
# See README for usage.
-# Clones every repo in build/doc-sources.csv into the directory given as the
+# Clones every repo in build/doc-sources.toml into the directory given as the
# first argument (default: the parent directory of this repo). Repos that are
# already there are left alone.
set -e
-registry="$(cd "$(dirname "$0")" && pwd)/doc-sources.csv"
+registry=$(python3 "$(dirname "$0")/doc-sources.py")
cd "${1:-$(dirname "$0")/../..}"
-tail -n +2 "$registry" | while IFS=, read -r name repository branch path role; do
- [ -n "$name" ] || continue
+while IFS=$'\t' read -r name repository branch path role; do
if [ -e "$path" ]; then
echo "$name: $path exists, skipped"
continue
@@ -21,4 +20,4 @@ tail -n +2 "$registry" | while IFS=, read -r name repository branch path role; d
git -C "$path" fetch --quiet --depth 1 origin '+refs/tags/*:refs/tags/*'
fi
echo "$name: cloned $repository $branch into $path"
-done
+done <<< "$registry"
diff --git a/build/doc-sources.csv b/build/doc-sources.csv
deleted file mode 100644
index adf00a3e..00000000
--- a/build/doc-sources.csv
+++ /dev/null
@@ -1,9 +0,0 @@
-name,repository,branch,path,role
-valkey,valkey-io/valkey,unstable,valkey,core
-valkey-bloom,valkey-io/valkey-bloom,unstable,valkey-bloom,module
-valkey-json,valkey-io/valkey-json,unstable,valkey-json,module
-valkey-search,valkey-io/valkey-search,main,valkey-search,module
-valkey-ldap,valkey-io/valkey-ldap,main,valkey-ldap,module
-valkey-bundle,valkey-io/valkey-bundle,mainline,valkey-bundle,other
-valkey-large-object,valkey-io/valkey-large-object,main,valkey-large-object,module
-valkey-doc,valkey-io/valkey-doc,main,valkey-doc,fallback
diff --git a/build/doc-sources.py b/build/doc-sources.py
new file mode 100755
index 00000000..83ecaa6f
--- /dev/null
+++ b/build/doc-sources.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+# Checks build/doc-sources.toml (or the file given as the first argument) and
+# prints one tab-separated line per source, in file order:
+# name repository branch path role
+# Used by build/checkout-doc-sources.sh and build/init-docs.sh.
+import sys
+
+if sys.version_info < (3, 11):
+ sys.exit("build/doc-sources.py needs Python 3.11 or later (for tomllib), found %d.%d"
+ % sys.version_info[:2])
+
+import os
+import tomllib
+
+KEYS = ["name", "repository", "branch", "path", "role"]
+ROLES = ["core", "module", "fallback", "other"]
+
+path = sys.argv[1] if len(sys.argv) > 1 else os.path.join(os.path.dirname(os.path.abspath(__file__)), "doc-sources.toml")
+
+
+def fail(message):
+ sys.exit("%s: %s" % (path, message))
+
+
+try:
+ with open(path, "rb") as f:
+ sources = tomllib.load(f).get("source", [])
+except (OSError, tomllib.TOMLDecodeError) as e:
+ fail(e)
+
+if not isinstance(sources, list) or not all(isinstance(s, dict) for s in sources):
+ fail("'source' must be an array of tables ([[source]])")
+
+for n, source in enumerate(sources, 1):
+ for key in KEYS:
+ value = source.get(key)
+ if not isinstance(value, str) or not value or any(c in value for c in "\t\n"):
+ fail("source %d (%s) needs '%s', a non-empty string on one line"
+ % (n, source.get("name", "no name"), key))
+ if source["role"] not in ROLES:
+ fail("source %d (%s) has role '%s', must be one of %s"
+ % (n, source["name"], source["role"], ", ".join(ROLES)))
+
+for role in ["core", "fallback"]:
+ found = [s["name"] for s in sources if s["role"] == role]
+ if len(found) != 1:
+ fail("needs exactly one source with role '%s', found %d%s"
+ % (role, len(found), " (%s)" % ", ".join(found) if found else ""))
+
+for source in sources:
+ print("\t".join(source[key] for key in KEYS))
diff --git a/build/doc-sources.toml b/build/doc-sources.toml
new file mode 100644
index 00000000..fa40a4fa
--- /dev/null
+++ b/build/doc-sources.toml
@@ -0,0 +1,90 @@
+# The repos the documentation comes from. See "Building additional content"
+# in README.md.
+#
+# One [[source]] table per repo. Their order is the menu merge order: the
+# other repos' menu files are merged into the core menu in this order.
+#
+# name The repo's name in the menu data and the stub comments, and the
+# name of its fallback menu file (modules-nav/.yml in the
+# fallback repo).
+# repository The GitHub repo (owner/name) that build/checkout-doc-sources.sh
+# clones, and where "Update this Page on GitHub!" points.
+# branch The branch to clone and link to. To build against a fork's
+# branch, change repository and branch.
+# path The checkout directory, relative to the directory that holds
+# this repo.
+# role One of:
+# core valkey: the core menu (docs/nav.yml), groups.json and
+# the generated module API reference. Exactly one.
+# module A module: its menu entries get a "module" label.
+# fallback valkey-doc: pages, menus and data files that haven't
+# moved to a code repo yet. Exactly one.
+# other Any other repo with docs.
+#
+# To add a module, add a [[source]] table with role = "module" where its menu
+# entries should go, for example:
+#
+# [[source]]
+# name = "valkey-example"
+# repository = "valkey-io/valkey-example"
+# branch = "main"
+# path = "valkey-example"
+# role = "module"
+#
+# build/doc-sources.py checks this file and prints it for the shell scripts.
+
+[[source]]
+name = "valkey"
+repository = "valkey-io/valkey"
+branch = "unstable"
+path = "valkey"
+role = "core"
+
+[[source]]
+name = "valkey-bloom"
+repository = "valkey-io/valkey-bloom"
+branch = "unstable"
+path = "valkey-bloom"
+role = "module"
+
+[[source]]
+name = "valkey-json"
+repository = "valkey-io/valkey-json"
+branch = "unstable"
+path = "valkey-json"
+role = "module"
+
+[[source]]
+name = "valkey-search"
+repository = "valkey-io/valkey-search"
+branch = "main"
+path = "valkey-search"
+role = "module"
+
+[[source]]
+name = "valkey-ldap"
+repository = "valkey-io/valkey-ldap"
+branch = "main"
+path = "valkey-ldap"
+role = "module"
+
+[[source]]
+name = "valkey-bundle"
+repository = "valkey-io/valkey-bundle"
+branch = "mainline"
+path = "valkey-bundle"
+role = "other"
+
+[[source]]
+name = "valkey-large-object"
+repository = "valkey-io/valkey-large-object"
+branch = "main"
+path = "valkey-large-object"
+role = "module"
+
+[[source]]
+name = "valkey-doc"
+repository = "valkey-io/valkey-doc"
+branch = "main"
+path = "valkey-doc"
+role = "fallback"
diff --git a/build/init-docs.sh b/build/init-docs.sh
index 2cbaf6a3..17e3aee0 100755
--- a/build/init-docs.sh
+++ b/build/init-docs.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# See README for usage.
# Gathers the command and topic docs from the repos listed in
-# build/doc-sources.csv, checked out under the directory given as the first
+# build/doc-sources.toml, checked out under the directory given as the first
# argument (default: the parent directory of this repo), and creates the stub
# files that tell Zola to build a page for each command and topic.
@@ -32,12 +32,13 @@ if [ -e "content/docs/topics" ]; then
exit 1
fi
-# The registry: one row per repo, in menu order. Arrays rather than an
+# The registry: one line per repo, in menu order. doc-sources.py checks that
+# there is exactly one core and one fallback repo. Arrays rather than an
# associative array, for the bash 3.2 that ships with macOS.
+registry=$(python3 build/doc-sources.py) || exit 1
names=(); repositories=(); branches=(); paths=()
core=""; fallback=""
-while IFS=, read -r name repository branch path role; do
- [ -n "$name" ] || continue
+while IFS=$'\t' read -r name repository branch path role; do
i=${#names[@]}
names[i]=$name; repositories[i]=$repository; branches[i]=$branch; paths[i]=$path
case "$role" in
@@ -48,11 +49,7 @@ while IFS=, read -r name repository branch path role; do
echo "$name must be checked out at $sources/$path (see build/checkout-doc-sources.sh)"
exit 1
fi
-done < <(tail -n +2 build/doc-sources.csv)
-if [ -z "$core" ] || [ -z "$fallback" ]; then
- echo "build/doc-sources.csv needs one repo with the role 'core' and one with the role 'fallback'"
- exit 1
-fi
+done <<< "$registry"
duplicates=0
diff --git a/config.toml b/config.toml
index b65e51d1..3cbe7208 100644
--- a/config.toml
+++ b/config.toml
@@ -31,7 +31,7 @@ command_json_path = "../build-command-json/"
doc_topic_path = "../build-topics/"
# The repos the docs come from (see README).
-doc_sources_path = "../build/doc-sources.csv"
+doc_sources_path = "../build/doc-sources.toml"
# Documentation menu, gathered by build/init-docs.sh. The core menu is the
# core repo's nav.yml. The other repos can provide a menu file that is merged
diff --git a/templates/macros/nav.html b/templates/macros/nav.html
index ad82b82f..23d52c82 100644
--- a/templates/macros/nav.html
+++ b/templates/macros/nav.html
@@ -5,7 +5,7 @@
The core menu defines the sections. A source's menu file can add topics to
a core section ("section: ") or add a new section ("id: ..."),
optionally placed after a core section ("after: "). The files are
- merged in the order of the doc sources (build/doc-sources.csv).
+ merged in the order of the doc sources (build/doc-sources.toml).
The menu is lenient: it leaves out what doesn't fit instead of failing the
build. Topics that don't exist, entries for unknown sections, and
@@ -36,8 +36,8 @@
{#- Menu files of other sources that exist. Entries that refer to unknown sections are
never matched below, so they're left out. -#}
{%- set sources = [] -%}
- {%- set doc_sources = load_data(path=extra.doc_sources_path, format="csv") -%}
- {%- for name in [r[0] for r in doc_sources.records if r[4] not in ["core", "fallback"]] -%}
+ {%- set doc_sources = load_data(path=extra.doc_sources_path, format="toml") -%}
+ {%- for name in [s.name for s in doc_sources.source if s.role not in ["core", "fallback"]] -%}
{%- set entries = load_data(path=extra.nav_sources_path ~ name ~ ".yml", format="yaml", required=false) -%}
{%- if entries -%}
{%- set_global sources = [...sources, {"name": name, "entries": entries}] -%}
@@ -264,11 +264,11 @@
{% endcomponent nav_pager %}
{#- The label shown next to a doc source's menu entries: "module" for the
- repos with the role "module" in build/doc-sources.csv, otherwise none. -#}
+ repos with the role "module" in build/doc-sources.toml, otherwise none. -#}
{% component nav_badge(source, extra) %}
-{%- set doc_sources = load_data(path=extra.doc_sources_path, format="csv") -%}
-{%- for r in doc_sources.records -%}
- {%- if r[0] == source and r[4] == "module" -%}module{%- endif -%}
+{%- set doc_sources = load_data(path=extra.doc_sources_path, format="toml") -%}
+{%- for s in doc_sources.source -%}
+ {%- if s.name == source and s.role == "module" -%}module{%- endif -%}
{%- endfor -%}
{% endcomponent nav_badge %}
From 2c0e5ab1e55314d7fb1488531097fbd360a1b1ca Mon Sep 17 00:00:00 2001
From: Madelyn Olson
Date: Mon, 30 Nov 2026 08:39:39 +0000
Subject: [PATCH 8/8] Take the Valkey Bundle page from valkey-doc
Valkey Bundle isn't a module and its page stays in valkey-doc, so
valkey-bundle is no longer a doc source. The fallback's menu files that no
source is named after (modules-nav/valkey-bundle.yml) are merged last.
Without its only user, the "other" role goes away.
Signed-off-by: Madelyn Olson
---
README.md | 6 +++---
build/doc-sources.py | 2 +-
build/doc-sources.toml | 12 +++---------
build/init-docs.sh | 7 +++++++
templates/macros/nav.html | 2 +-
5 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index a41ac564..8bccfcd6 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ The script downloads the SPDX license list, so it needs network access.
**By default, the site will build without documentation topics or the command reference.**
The command and topic pages live next to the code: valkey's in [`valkey-io/valkey`](https://github.com/valkey-io/valkey), each module's in its own repo.
-[`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) is the fallback for pages that haven't moved yet, and still holds `modules.json`.
+[`valkey-io/valkey-doc`](https://github.com/valkey-io/valkey-doc) is the fallback: it holds the pages that haven't moved yet and the pages that live there, such as the Valkey Bundle page, and `modules.json`.
The clients and integrations pages (`/clients/`, `/integrations/`) are built from `_data/libraries/` in this repo, so they need no other repo.
To build the site with the docs, check out the repos listed in `build/doc-sources.toml` next to this repo, then gather their docs (the scripts need Python 3.11 or later to read the TOML file):
@@ -76,7 +76,7 @@ Each repo in `build/doc-sources.toml` can provide:
The fallback repo (valkey-doc) has the same files without the `docs/` prefix, its menu files in `nav.yml` and `modules-nav/.yml`.
A code repo's file wins over the fallback's copy with the same name.
If two code repos provide the same command, topic, image or command JSON, `init-docs.sh` lists both paths and fails, so a URL can't silently change source.
-The menu merges the core repo's `nav.yml` with the other repos' menu files, in the order of `build/doc-sources.toml`.
+The menu merges the core repo's `nav.yml` with the other repos' menu files, in the order of `build/doc-sources.toml`, then the fallback's menu files that no repo is named after.
`/topics/modules-api-ref/` is generated from valkey's `src/module.c` with `utils/generate-module-api-doc.rb`, which needs Ruby 2.3 or later and valkey's release tags (`checkout-doc-sources.sh` fetches them).
Without Ruby, the fallback's copy is used if it has one.
@@ -97,7 +97,7 @@ role = "module"
- `name`: the repo's name in the menu data and the stub comments, and the name of its fallback menu file (`modules-nav/.yml`).
- `repository` and `branch`: what CI checks out, and where "Update this Page on GitHub!" points. To build against a fork's branch, change these two.
- `path`: the checkout directory, relative to the directory that holds this repo.
-- `role`: `core` (valkey: the core menu and `groups.json`), `fallback` (valkey-doc), `module` (its menu entries get a "module" label), or `other`.
+- `role`: `core` (valkey: the core menu and `groups.json`), `fallback` (valkey-doc), or `module` (its menu entries get a "module" label).
### Checking links
diff --git a/build/doc-sources.py b/build/doc-sources.py
index 83ecaa6f..abb0d651 100755
--- a/build/doc-sources.py
+++ b/build/doc-sources.py
@@ -13,7 +13,7 @@
import tomllib
KEYS = ["name", "repository", "branch", "path", "role"]
-ROLES = ["core", "module", "fallback", "other"]
+ROLES = ["core", "module", "fallback"]
path = sys.argv[1] if len(sys.argv) > 1 else os.path.join(os.path.dirname(os.path.abspath(__file__)), "doc-sources.toml")
diff --git a/build/doc-sources.toml b/build/doc-sources.toml
index fa40a4fa..6178bf4a 100644
--- a/build/doc-sources.toml
+++ b/build/doc-sources.toml
@@ -18,8 +18,9 @@
# the generated module API reference. Exactly one.
# module A module: its menu entries get a "module" label.
# fallback valkey-doc: pages, menus and data files that haven't
-# moved to a code repo yet. Exactly one.
-# other Any other repo with docs.
+# moved to a code repo yet, and pages that live there,
+# such as the Valkey Bundle page. Its menu files that
+# no source is named after are merged last. Exactly one.
#
# To add a module, add a [[source]] table with role = "module" where its menu
# entries should go, for example:
@@ -68,13 +69,6 @@ branch = "main"
path = "valkey-ldap"
role = "module"
-[[source]]
-name = "valkey-bundle"
-repository = "valkey-io/valkey-bundle"
-branch = "mainline"
-path = "valkey-bundle"
-role = "other"
-
[[source]]
name = "valkey-large-object"
repository = "valkey-io/valkey-large-object"
diff --git a/build/init-docs.sh b/build/init-docs.sh
index 17e3aee0..325f02e0 100755
--- a/build/init-docs.sh
+++ b/build/init-docs.sh
@@ -285,6 +285,13 @@ for i in "${!names[@]}"; do
link_first "build-nav/${names[$i]}.yml" "$sources/${paths[$i]}/docs/nav.yml" "$fallback_dir/modules-nav/${names[$i]}.yml"
fi
done
+# The fallback's own menu: its menu files that no source is named after.
+rm -f "build-nav/${names[$fallback]}.yml"
+for f in "$fallback_dir"/modules-nav/*.yml; do
+ [ -f "$f" ] && [ ! -e "build-nav/$(basename "$f")" ] || continue
+ { cat "$f"; echo; } >> "build-nav/${names[$fallback]}.yml"
+ echo "Added ${f#"$sources"/} to build-nav/${names[$fallback]}.yml"
+done
link_first _data/groups.json "$core_dir/docs/groups.json" "$fallback_dir/groups.json"
for datafile in modules.json resp2_replies.json resp3_replies.json; do
diff --git a/templates/macros/nav.html b/templates/macros/nav.html
index 23d52c82..800ac868 100644
--- a/templates/macros/nav.html
+++ b/templates/macros/nav.html
@@ -37,7 +37,7 @@
never matched below, so they're left out. -#}
{%- set sources = [] -%}
{%- set doc_sources = load_data(path=extra.doc_sources_path, format="toml") -%}
- {%- for name in [s.name for s in doc_sources.source if s.role not in ["core", "fallback"]] -%}
+ {%- for name in [s.name for s in doc_sources.source if s.role != "core"] -%}
{%- set entries = load_data(path=extra.nav_sources_path ~ name ~ ".yml", format="yaml", required=false) -%}
{%- if entries -%}
{%- set_global sources = [...sources, {"name": name, "entries": entries}] -%}