mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
feat: include script tags in testimonials JS output
This commit is contained in:
parent
6d30094a93
commit
761a297903
2 changed files with 5 additions and 6 deletions
|
@ -449,11 +449,11 @@ def get_testimonials_js():
|
|||
{"text": quote_match, "author": author_match, "link": link_match}
|
||||
)
|
||||
|
||||
# Format as JavaScript array
|
||||
# Format as JavaScript array with script tags
|
||||
if not testimonials:
|
||||
return "const testimonials = [];"
|
||||
return "<script>\nconst testimonials = [];\n</script>"
|
||||
|
||||
js_array = "const testimonials = [\n"
|
||||
js_array = "<script>\nconst testimonials = [\n"
|
||||
for i, t in enumerate(testimonials):
|
||||
js_array += " {\n"
|
||||
js_array += f" text: \"{t['text']}\",\n"
|
||||
|
@ -463,14 +463,14 @@ def get_testimonials_js():
|
|||
if i < len(testimonials) - 1:
|
||||
js_array += ","
|
||||
js_array += "\n"
|
||||
js_array += "];"
|
||||
js_array += "];\n</script>"
|
||||
|
||||
return js_array
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error reading testimonials from README: {e}", file=sys.stderr)
|
||||
# Return empty array as fallback
|
||||
return "const testimonials = [];"
|
||||
return "<script>\nconst testimonials = [];\n</script>"
|
||||
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue