Skip to content

Commit 5a826ad

Browse files
authored
Support website links in client list and fix template variable shadowing (#418)
## Overview This PR is a proposal to add a website link to the client list page to support linking the new Valkey GLIDE website. It also fixes a bug in the template file. ## Issue The client page only display repo links and does not support website link. ### Adding Website Links The template now displays a link to the client's website, if one is provided in the client's data file. This is handled by conditionally rendering the link only when a non-empty website URL is available. Here's what the python section looks like: <img width="1389" height="611" alt="image" src="https://github.com/user-attachments/assets/12a4ada6-eb60-4254-9002-c1291090abdf" /> ### Fixes Variable Shadowing Resolves an issue where a `client` variable was being shadowed within a loop, which could lead to unpredictable behavior. The shadowing variable has been renamed to `first_client`. ### Related issues #416 --------- Signed-off-by: Alex Le <[email protected]>
1 parent 50b85ed commit 5a826ad

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

templates/client-list.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
{% block main_content %}
55
{% set client_path = section.extra.recommended_clients_paths | first %}
6-
{% set client = load_data(path = docs::client_json_path(client_path=client_path), format="json", required = false) %}
7-
{% if not client %}
6+
{% set first_client = load_data(path = docs::client_json_path(client_path=client_path), format="json", required = false) %}
7+
{% if not first_client %}
88
<strong>Clients page not found.</strong> You likely need to build the client page. See "Building additional content" in the README.md file.
99
{% else %}
1010
<div class="markdown-content">
@@ -37,6 +37,9 @@ <h2 id="{{ language | slugify }}">{{ docs::format_language(language=language) }}
3737
<h3 id="{{ client.name | slugify }}">{{ client.name }}</h3>
3838
<ul>
3939
<li><strong>Repo:</strong> <a href="{{ client.repo }}">{{ client.name }}</a></li>
40+
{% if client.website %}
41+
<li><strong>Website:</strong> <a href="{{ client.website }}">{{ client.website }}</a></li>
42+
{% endif %}
4043
<li>
4144
<strong>Installation:</strong>
4245
{% if client.installation is iterable %}

0 commit comments

Comments
 (0)