From 615d3440380eebc9260b9db4e418d6edbe8fa4a0 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Wed, 8 Jan 2025 16:35:59 -0800 Subject: [PATCH] Gracefully handle missining resp2 and resp3 responses (#189) Signed-off-by: Madelyn Olson --- templates/command-page.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/command-page.html b/templates/command-page.html index 7286628..b431896 100644 --- a/templates/command-page.html +++ b/templates/command-page.html @@ -75,10 +75,12 @@ {% set_global resp2_replies = load_data(path="../_data/resp2_replies.json", required=false) -%} {% set_global resp3_replies = load_data(path="../_data/resp3_replies.json", required=false) -%} {% if resp2_replies and resp3_replies -%} - {% set resp2_reply = resp2_replies | get(key=command_title) | join(sep="\n\n") -%} - {% set resp3_reply = resp3_replies | get(key=command_title) | join(sep="\n\n") -%} + {% set resp2_reply = resp2_replies | get(key=command_title, default="") -%} + {% set resp3_reply = resp3_replies | get(key=command_title, default="") -%} - {% if resp2_reply or resp3_reply -%} + {% if resp2_reply and resp2_reply != "" and resp3_reply and resp3_reply != "" -%} + {% set resp2_reply = resp2_reply | join(sep="\n\n") -%} + {% set resp3_reply = resp3_reply | join(sep="\n\n") -%} {% if resp2_reply == resp3_reply -%}

RESP2/RESP3 Reply

{{ commands::fix_links(content=resp2_reply) | markdown | safe }}