Skip to content

Commit 9d8abed

Browse files
authored
Added valkey-search support (#259)
With this PR, I have added support for `valkey-search` website content (topic + commands reference). Related PR (man pages): valkey-io/valkey-doc#275 <img width="1918" alt="Screenshot 2025-05-14 at 19 19 15" src="https://github.com/user-attachments/assets/23d1ee8b-262f-498e-949e-9e30b9b8ccb4" /> <img width="1797" alt="Screenshot 2025-05-14 at 19 18 40" src="https://github.com/user-attachments/assets/36618369-ec1d-441d-bb70-1916c493a491" /> Signed-off-by: Eran Ifrah <[email protected]>
1 parent 68ada49 commit 9d8abed

File tree

8 files changed

+55
-25
lines changed

8 files changed

+55
-25
lines changed

.github/workflows/zola-deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ jobs:
4040
repository: valkey-io/valkey-bloom
4141
path: valkey-bloom
4242

43+
- name: Checkout valkey-search
44+
uses: actions/checkout@v4
45+
with:
46+
repository: valkey-io/valkey-search
47+
path: valkey-search
48+
4349
- name: Checkout valkey-json
4450
uses: actions/checkout@v4
4551
with:
@@ -50,7 +56,7 @@ jobs:
5056
run: |
5157
cd website
5258
./build/init-topics-and-clients.sh ../valkey-doc/topics ../valkey-doc/clients
53-
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands ../valkey-bloom/src/commands ../valkey-json/src/commands
59+
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands ../valkey-bloom/src/commands ../valkey-json/src/commands ../valkey-search/src/commands
5460
5561
- name: Build only
5662
uses: shalzz/[email protected]

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Valkey.io website
22

33
This repo contains the source for the valkey.io website (build scripts, template, blog posts, stylesheets, etc.).
4-
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)
4+
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)
55

66
## Contributing
77

@@ -29,7 +29,7 @@ Changes to external content (command reference, documentation topics) require a
2929
## Building additional content
3030

3131
**By default, the site will build without documentation topics, command reference, or the clients page.**
32-
The content for documentation topics and the clients page are stored within the `valkey-io/valkey-doc` repo.
32+
The content for documentation topics and the clients page are stored within the `valkey-io/valkey-doc` repo.
3333
The content for the command reference page is in the `valkey-io/valkey` repo.
3434

3535
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.
@@ -64,7 +64,8 @@ Commit your changes to your local copy of `valkey-io/valkey-doc`.
6464
### Building the command reference
6565

6666
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`.
67-
`valkey-io/valkey`, `valkey-io/valkey-bloom` and `valkey-io/valkey-json` 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.
67+
`valkey-io/valkey`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json` and `valkey-io/valkey-search` provides the command metadata (items like computational complexity, version history, arguments, etc)
68+
whilst `valkey-io/valkey-doc` provides the command description and the command reply.
6869

6970
```mermaid
7071
flowchart TD
@@ -75,13 +76,16 @@ flowchart TD
7576
H --> J[Files: /resp2_replies.json,<br/>/resp3_replies.json] --> Z[Command Reply]
7677
```
7778

78-
Let's say that this repo and your local copy of `valkey-io/valkey-doc`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, and `valkey-io/valkey` reside in the same directories.
79+
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`
80+
and `valkey-io/valkey` reside in the same directories.
81+
7982
First, stop the `zola serve` process if you're running it.
8083
From the root directory of this repo run:
8184

8285
```shell
8386
# You should only need to run this once or when you add a new command.
84-
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands ../valkey-bloom/src/commands ../valkey-json/src/commands
87+
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands \
88+
../valkey-bloom/src/commands ../valkey-json/src/commands ../valkey-search/src/commands
8589
```
8690

8791
Then, restart Zola.

build/init-commands.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
# first check to make sure there are arguments
66
if [ -z "$1" ]; then
7-
echo "You must supply a path to the command docs as the first argument"
7+
echo "You must supply a path to the command docs as the first argument"
88
exit 1
9-
fi
9+
fi
1010

1111
if [ -z "$2" ]; then
12-
echo "You must supply a path to the command json as the second argument"
12+
echo "You must supply a path to the command json as the second argument"
1313
exit 1
1414
fi
1515

16-
# check for validity of these agruments as paths
16+
# check for validity of these arguments as paths
1717
if [ ! -d "$1" ]; then
1818
echo "The command doc directory must exist and be a valid path"
1919
exit 1
@@ -34,22 +34,31 @@ if [ ! -d "$4" ]; then
3434
exit 1
3535
fi
3636

37+
if [ ! -d "$5" ]; then
38+
echo "The Search module command JSON directory must exist and be a valid path"
39+
exit 1
40+
fi
41+
3742
ln -s $1 ./build-command-docs
3843
ln -s $2 ./build-command-json
3944
ln -s $3 ./build-bloom-command-json
4045
ln -s $4 ./build-json-command-json
46+
ln -s $5 ./build-search-command-json
47+
4148
for fname in $(find $1 -maxdepth 1 -iname "*.md")
4249
do
4350
base=${fname##*/}
4451
command=${base%.*}
4552
command_upper=$(awk '{ print toupper($0) }' <<< $command)
46-
if [[ "$command" != "index" ]]; then
53+
if [[ "$command" != "index" ]]; then
4754
if [ -f "$2/$command.json" ]; then
4855
metadata_path="/commands/$command.json in the 'valkey' repo"
4956
elif [ -f "$3/$command.json" ]; then
5057
metadata_path="/commands/$command.json in the 'valkey-bloom' repo"
5158
elif [ -f "$4/$command.json" ]; then
5259
metadata_path="/commands/$command.json in the 'valkey-json' repo"
60+
elif [ -f "$5/$command.json" ]; then
61+
metadata_path="/commands/$command.json in the 'valkey-search' repo"
5362
fi
5463
cat << EOF > "./content/commands/$command.md"
5564
+++

build/init-topics-and-clients.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
# first check to make sure there are arguments
66
if [ -z "$1" ]; then
7-
echo "You must supply a path to the topics as the first argument"
7+
echo "You must supply a path to the topics as the first argument"
88
exit 1
9-
fi
9+
fi
1010

1111
if [ -z "$2" ]; then
12-
echo "You must supply a path to the clients directory as the first argument"
12+
echo "You must supply a path to the clients directory as the second argument"
1313
exit 1
14-
fi
14+
fi
1515

16-
# check for validity of these agruments as paths
16+
# check for validity of these arguments as paths
1717
if [ ! -d "$1" ]; then
1818
echo "The topics directory must exist and be a valid path"
1919
exit 1

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ command_description_path = "../build-command-docs/"
2323
command_json_path = "../build-command-json/"
2424
command_bloom_json_path = "../build-bloom-command-json/"
2525
command_json_json_path = "../build-json-command-json/"
26+
command_search_json_path = "../build-search-command-json/"
2627
client_json_path = "../build-clients/"
2728
doc_topic_path = "../build-topics/"
2829

templates/command-page.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
{% set command_sources = [
1111
load_data(path= commands::command_json_path(slug= page.slug), required= false),
1212
load_data(path= commands::command_bloom_json_path(slug= page.slug), required= false),
13-
load_data(path= commands::command_json_json_path(slug= page.slug), required= false)
13+
load_data(path= commands::command_json_json_path(slug= page.slug), required= false),
14+
load_data(path= commands::command_search_json_path(slug= page.slug), required= false)
1415
] %}
1516

1617
{% set command_data = command_sources | filter(attribute="") | first %}
1718

1819
{% if command_data %}
1920
{% set command_obj_name = commands::command_obj_name(command_data= command_data) %}
20-
{% set command_data_obj = command_data[command_obj_name] %}
21+
{% set command_data_obj = command_data[command_obj_name] %}
2122
{% if command_data_obj.container %}
2223
{% set command_title = command_data_obj.container ~ " " ~ command_obj_name %}
2324
{% else %}
@@ -57,14 +58,18 @@
5758
{% endif %}
5859
{% if command_data_obj.module_since %}
5960
<dl>
60-
{% if "bf." in page.slug %}
61+
{% if "bf." in page.slug %}
6162
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
6263
<dt>Module:</dt>
6364
<dd><a href={{module_reply.valkey_bloom.repo}}>{{module_reply.valkey_bloom.name}}</a></dd>
6465
{% elif "json." in page.slug %}
6566
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
6667
<dt>Module:</dt>
6768
<dd><a href={{module_reply.valkey_json.repo}}>{{module_reply.valkey_json.name}}</a></dd>
69+
{% elif "ft." in page.slug %}
70+
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
71+
<dt>Module:</dt>
72+
<dd><a href={{module_reply.valkey_search.repo}}>{{module_reply.valkey_search.name}}</a></dd>
6873
{% endif %}
6974
<dl>
7075
<dl>
@@ -188,7 +193,7 @@ <h3>History</h3>
188193
<td>{{ entry[1] | markdown | safe}}</td>
189194
</tr>
190195
{% endfor %}
191-
196+
192197
</tbody>
193198
</table>
194199
{% endif %}

templates/commands.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ <h4>We couldn't find any results matching your search</h4>
2727
{% for json_path in [
2828
commands::command_json_path(slug=page.slug),
2929
commands::command_bloom_json_path(slug=page.slug),
30-
commands::command_json_json_path(slug=page.slug)
30+
commands::command_json_json_path(slug=page.slug),
31+
commands::command_search_json_path(slug=page.slug)
3132
] %}
3233
{% set command_data = load_data(path= json_path, required= false) %}
3334
{% if command_data %}
@@ -39,7 +40,7 @@ <h4>We couldn't find any results matching your search</h4>
3940
{% endif %}
4041
{% set command_entry = [
4142
command_display,
42-
page.permalink | safe,
43+
page.permalink | safe,
4344
command_data_obj.summary,
4445
command_data_obj.group
4546
] %}

templates/macros/command.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,21 @@
4848
{{ command_obj_name }}
4949
{%- endmacro command_obj_name -%}
5050

51+
{%- macro command_search_json_path(slug) -%}
52+
{{config.extra.command_search_json_path }}{{ slug }}.json
53+
{%- endmacro command_search_json_path -%}
54+
5155
{%- macro command_json_path(slug) -%}
5256
{{config.extra.command_json_path }}{{ slug }}.json
53-
{%- endmacro load_command_json -%}
57+
{%- endmacro command_json_path -%}
5458

5559
{%- macro command_bloom_json_path(slug) -%}
5660
{{config.extra.command_bloom_json_path }}{{ slug }}.json
57-
{%- endmacro load_bloom_command_json -%}
61+
{%- endmacro command_bloom_json_path -%}
5862

5963
{%- macro command_json_json_path(slug) -%}
6064
{{config.extra.command_json_json_path }}{{ slug }}.json
61-
{%- endmacro load_json_command_json -%}
65+
{%- endmacro command_json_json_path -%}
6266

6367
{%- macro fix_links(content) -%}
6468
{{ content

0 commit comments

Comments
 (0)