From 1ba4dd46a1192deb0b38bf32b78143d7fb5cef60 Mon Sep 17 00:00:00 2001 From: Lior Sventitzky Date: Thu, 12 Jun 2025 07:49:55 +0000 Subject: [PATCH] changed method of checking for clients existence Signed-off-by: Lior Sventitzky --- templates/client-list.html | 126 +++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/templates/client-list.html b/templates/client-list.html index 0e6847b5..8487ab5d 100644 --- a/templates/client-list.html +++ b/templates/client-list.html @@ -2,68 +2,74 @@ {% import "macros/docs.html" as docs %} {% block main_content %} -
- {% set content_parts = section.content | split(pat="") %} - {{ content_parts[0] | markdown | safe }} -
+ {% set client_path = section.extra.recommended_clients_paths | first %} + {% set client = load_data(path = docs::client_json_path(client_path=client_path), format="json", required = false) %} + {% if not client %} + Clients page not found. You likely need to build the client page. See "Building additional content" in the README.md file. + {% else %} +
+ {% set content_parts = section.content | split(pat="") %} + {{ content_parts[0] | markdown | safe }} +
-
-

Table of Contents

-
    - {% set languages = [] %} - {% for path in section.extra.recommended_clients_paths %} - {% set language = path | split(pat="/") | nth(n=1) %} - {% if language not in languages %} - {% set_global languages = languages | concat(with=language) %} - {% endif %} - {% endfor %} - {% for language in languages %} -
  • {{ docs::format_language(language=language) }}
  • - {% endfor %} -
  • Feature Comparison Table
  • -
- {% for language in languages %} -
-

{{ docs::format_language(language=language) }}

+
+

Table of Contents

+
    + {% set languages = [] %} {% for path in section.extra.recommended_clients_paths %} - {% set client = load_data(path = docs::client_json_path(client_path= path), format="json") %} - {% if client.language == language %} -
    -

    {{ client.name }}

    -
      -
    • Repo: {{ client.name }}
    • -
    • - Installation: - {% if client.installation is iterable %} -
        - {% for installation_type in client.installation %} -
      • - {{ installation_type.type }}: -
        {{ installation_type.command }}
        -
      • - {% endfor %} -
      - {% else %} - {{ client.installation }} - {% endif %} -
    • -
    • Version: {{ client.version }}
    • -
    • Version Released: {{ client.version_released }}
    • -
    • Description: {{ client.description }}
    • -
    • License: {{ client.license }}
    • -
    -
    + {% set language = path | split(pat="/") | nth(n=1) %} + {% if language not in languages %} + {% set_global languages = languages | concat(with=language) %} {% endif %} {% endfor %} -
- {% endfor %} -
-
- {{ content_parts[1] | markdown | safe }} -
-
- {% set client_paths = section.extra.recommended_clients_paths %} - {% set client_fields = section.extra.client_fields %} - {% include "client-feature-table.html" %} -
+ {% for language in languages %} +
  • {{ docs::format_language(language=language) }}
  • + {% endfor %} +
  • Feature Comparison Table
  • + + {% for language in languages %} +
    +

    {{ docs::format_language(language=language) }}

    + {% for path in section.extra.recommended_clients_paths %} + {% set client = load_data(path = docs::client_json_path(client_path= path), format="json") %} + {% if client.language == language %} +
    +

    {{ client.name }}

    +
      +
    • Repo: {{ client.name }}
    • +
    • + Installation: + {% if client.installation is iterable %} +
        + {% for installation_type in client.installation %} +
      • + {{ installation_type.type }}: +
        {{ installation_type.command }}
        +
      • + {% endfor %} +
      + {% else %} + {{ client.installation }} + {% endif %} +
    • +
    • Version: {{ client.version }}
    • +
    • Version Released: {{ client.version_released }}
    • +
    • Description: {{ client.description }}
    • +
    • License: {{ client.license }}
    • +
    +
    + {% endif %} + {% endfor %} +
    + {% endfor %} +
    +
    + {{ content_parts[1] | markdown | safe }} +
    +
    + {% set client_paths = section.extra.recommended_clients_paths %} + {% set client_fields = section.extra.client_fields %} + {% include "client-feature-table.html" %} +
    + {% endif %} {% endblock main_content %}