Skip to content

Commit

Permalink
Gracefully handle missining resp2 and resp3 responses (#189)
Browse files Browse the repository at this point in the history
Signed-off-by: Madelyn Olson <[email protected]>
  • Loading branch information
madolson committed Jan 9, 2025
1 parent c703f42 commit 615d344
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions templates/command-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
<h3>RESP2/RESP3 Reply</h3>
{{ commands::fix_links(content=resp2_reply) | markdown | safe }}
Expand Down

0 comments on commit 615d344

Please sign in to comment.