From 010a9a885311352ff096f0530d88a6295e5b1b81 Mon Sep 17 00:00:00 2001 From: tcouch Date: Fri, 15 Dec 2023 15:19:26 +0000 Subject: [PATCH] Fix project cards in search --- assets/js/search.js | 3 ++- search.html | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/assets/js/search.js b/assets/js/search.js index 6ec8e9f..1b11d75 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -12,7 +12,8 @@ var context = { title: item.title, url: item.url, - summary: item.content.substring(0, 200) + summary: item.content.substring(0, 200), + authors: item.authors }; var html = template(context); searchResults.innerHTML += html diff --git a/search.html b/search.html index c25205f..93d3b89 100644 --- a/search.html +++ b/search.html @@ -10,7 +10,7 @@ {%- for project in site.projects -%} "{{ project.url | slugify }}": { "title": "{{ project.title | xml_escape }}", - "authors": "{{ project.authors | join | replace: '_', ' ' | xml_escape }}", + "authors": "{{ project.authors | join: ", " | xml_escape }}", "category": "{{ project.category | xml_escape }}", "content": {{ project.content | strip_html | strip_newlines | jsonify }}, "url": "{{ project.url | xml_escape }}" @@ -22,14 +22,23 @@ {% raw %}