From f9a52508e518c9973f66186efc43b1ad24ea7289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Mon, 30 Dec 2024 23:35:06 +0100
Subject: [PATCH 01/13] fix: Markdown is no longer supported in listings (>=
1.7.5)
Fixes #11758
---
.../projects/website/listing/_filter.ejs.md | 31 +++---
.../projects/website/listing/_metadata.ejs.md | 2 +
.../website/listing/_pagination.ejs.md | 8 +-
.../website/listing/item-default.ejs.md | 64 +++++++----
.../projects/website/listing/item-grid.ejs.md | 102 ++++++++++--------
.../website/listing/listing-default.ejs.md | 6 +-
.../website/listing/listing-grid.ejs.md | 6 +-
.../website/listing/listing-table.ejs.md | 4 +-
8 files changed, 132 insertions(+), 91 deletions(-)
diff --git a/src/resources/projects/website/listing/_filter.ejs.md b/src/resources/projects/website/listing/_filter.ejs.md
index c72ec41fad..5dc37fa3b0 100644
--- a/src/resources/projects/website/listing/_filter.ejs.md
+++ b/src/resources/projects/website/listing/_filter.ejs.md
@@ -10,32 +10,29 @@ const sortUi = listing['sort-ui'];
<% const sortableFields = listing.utilities.sortableFieldData(); %>
<% if (sortUi && sortableFields.length > 0) { %>
>
+::: {.g-col-1 <%= listing.utilities.metadataAttrs(item) %> }
+
+```{=html}
-
+
+```
<% if (fields.includes('image')) { %>
-
<% if (item.image) { %>
-
-
+`
`{=html}
<%= listing.utilities.img(itemNumber, item.image, "thumbnail-image card-img", item['image-alt'], item['image-lazy-loading'] ?? listing['image-lazy-loading']) %>
-
+``{=html}
<% } else { %>
<%= listing.utilities.imgPlaceholder(listing.id, itemNumber, item.outputHref) %>
<% } %>
@@ -55,65 +56,82 @@ return !["title", "image", "image-alt", "date", "author", "subtitle", "descripti
<% } %>
<% if (showField('title') || showField('subtitle') || showField('description') || showField('author') || showField('date') || otherFields.length > 0) { %>
-
-<% if (showField('title')) { %>
<%= item.title %>
<% } %>
-<% if (showField('subtitle')) { %>
<%= item.subtitle %>
<% } %>
-<% if (showField('reading-time')) { %>
<%= item['reading-time'] %>
<% } %>
+`
`{=html}
+
+<% if (showField('title')) { %>
+`
`{=html} <%= item.title %> `
`{=html}
+<% } %>
+
+<% if (showField('subtitle')) { %>
+`
`{=html} <%= item.subtitle %> `
`{=html}
+<% } %>
+
+<% if (showField('reading-time')) { %>
+`
`{=html} <%= item['reading-time'] %> `
`{=html}
+<% } %>
<% if (fields.includes('categories') && item.categories) { %>
+`
`{=html}
-
- <% for (const category of item.categories) { %>
-
<%= category %>
- <% } %>
-
+<% for (const category of item.categories) { %>
+`
`{=html} <%= category %> `
`{=html}
+<% } %>
+`
`{=html}
<% } %>
-<% if (showField('description')) { %>
-
<%= item.description %>
+<% if (showField('description')) { %>
+`
`{=html} <%= item.description %> `
`{=html}
<% } %>
-<%
+
+<%
const flexJustify = showField('author') && showField('date') ? "justify" : showField('author') ? "start" : "end";
%>
+
<% if (showField('author') || showField('date')) { %>
-
-<% if (showField('author')) { %>
<%= item.author %>
<% } %>
-<% if (showField('date')) { %>
<%= item.date %>
<% } %>
-
+`
`{=html}
+
+<% if (showField('author')) { %>
+`
`{=html} <%= item.author %> `
`{=html}
<% } %>
-<% if (otherFields.length > 0) { %>
+<% if (showField('date')) { %>
+`
`{=html} <%= item.date %> `
`{=html}
+<% } %>
-
-<% for (const field of otherFields) {
-let value = readField(item, field);
-%>
-
-<%= listing.utilities.fieldName(field) %> |
-<%= listing.utilities.outputLink(item, field, value) %> |
-
+``{=html}
<% } %>
-
+<% if (otherFields.length > 0) { %>
+`
`{=html}
+<% for (const field of otherFields) {
+let value = readField(item, field);
+%>
+``{=html}
+``{=html} <%= listing.utilities.fieldName(field) %> ` | `{=html}
+``{=html} <%= listing.utilities.outputLink(item, field, value) %> ` | `{=html}
+`
`{=html}
+<% } %>
+`
`{=html}
<% } %>
-
+`
`{=html}
<% } %>
<% if (fields.includes('filename') || fields.includes('file-modified')) { %>
-`{=html}
<% } %>
-
+`
`{=html}
+
+:::
diff --git a/src/resources/projects/website/listing/listing-default.ejs.md b/src/resources/projects/website/listing/listing-default.ejs.md
index c95f18c77d..4ffe8c2213 100644
--- a/src/resources/projects/website/listing/listing-default.ejs.md
+++ b/src/resources/projects/website/listing/listing-default.ejs.md
@@ -1,7 +1,7 @@
-:::{.list .quarto-listing-default}
-``````{=html}
+::: {.list .quarto-listing-default}
+
<% for (const item of items) { %>
<% partial('item-default.ejs.md', {listing, item, utils }) %>
<% } %>
-``````
+
:::
diff --git a/src/resources/projects/website/listing/listing-grid.ejs.md b/src/resources/projects/website/listing/listing-grid.ejs.md
index f049b94bb3..19d7382972 100644
--- a/src/resources/projects/website/listing/listing-grid.ejs.md
+++ b/src/resources/projects/website/listing/listing-grid.ejs.md
@@ -2,10 +2,10 @@
const cols = listing['grid-columns'];
%>
-:::{.list .grid .quarto-listing-cols-<%=cols%>}
-```{=html}
+::: {.list .grid .quarto-listing-cols-<%= cols %>}
+
<% for (const item of items) { %>
<% partial('item-grid.ejs.md', {listing, item, utils }) %>
<% } %>
-```
+
:::
diff --git a/src/resources/projects/website/listing/listing-table.ejs.md b/src/resources/projects/website/listing/listing-table.ejs.md
index 864a26f70f..a5d78321ac 100644
--- a/src/resources/projects/website/listing/listing-table.ejs.md
+++ b/src/resources/projects/website/listing/listing-table.ejs.md
@@ -84,11 +84,13 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`);
<%= onclick(item) %>>
<% for (const field of fields){ %>
+```
<%= outputValue(itemNumber, field) %>
+```{=html}
|
<% } %>
<% } %>
-```
\ No newline at end of file
+```
From 4b4c36b8f1e05221de0587b237b15fd9c44e17dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Mon, 30 Dec 2024 23:41:51 +0100
Subject: [PATCH 02/13] revert: unwanted change
---
src/resources/projects/website/listing/_filter.ejs.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/resources/projects/website/listing/_filter.ejs.md b/src/resources/projects/website/listing/_filter.ejs.md
index 5dc37fa3b0..7e39a22d7e 100644
--- a/src/resources/projects/website/listing/_filter.ejs.md
+++ b/src/resources/projects/website/listing/_filter.ejs.md
@@ -23,7 +23,7 @@ const sortUi = listing['sort-ui'];
<% } %>
From 0f779cf95845d3cd550d6adaa9b6f03ee12a0da9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Thu, 2 Jan 2025 11:43:37 +0100
Subject: [PATCH 03/13] fix: use markdown div thus no raw block
---
.../projects/website/listing/_pagination.ejs.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/resources/projects/website/listing/_pagination.ejs.md b/src/resources/projects/website/listing/_pagination.ejs.md
index 5ec6d25200..c4db479dfa 100644
--- a/src/resources/projects/website/listing/_pagination.ejs.md
+++ b/src/resources/projects/website/listing/_pagination.ejs.md
@@ -1,10 +1,13 @@
-```{=html}
-
+::: {.listing-no-matching .d-none}
<%- listing.utilities.localizedString("listing-page-no-matches") %>
-
+:::
+
<% if (listing["page-size"] < items.length) { %>
+
+```{=html}
-<% } %>
```
+
+<% } %>
From 911207e1c1761f7fca002471f200d183e085c0cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Thu, 2 Jan 2025 11:46:56 +0100
Subject: [PATCH 04/13] refactor: use markdown syntax
---
.../projects/website/listing/_metadata.ejs.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/resources/projects/website/listing/_metadata.ejs.md b/src/resources/projects/website/listing/_metadata.ejs.md
index 7c26782f35..25ad0a5700 100644
--- a/src/resources/projects/website/listing/_metadata.ejs.md
+++ b/src/resources/projects/website/listing/_metadata.ejs.md
@@ -2,9 +2,9 @@
const categories = item.categories !== undefined ? item.categories.join(',') : undefined;
%>
-```{=html}
-
-
-<% if (categories !== undefined) { %><% } %>
-
-```
+::: {.quarto-listing-item-metadata" style-"display:none;"}
+[]{.original-value data-original-value="${itemNumber}" style="display:none;"}
+<% if (categories !== undefined) { %>
+[]{.categories data-categories="${categories}" style="display:none;"}
+<% } %>
+:::
From 8463bc7200ac86d87282a6f3981be8d178433a1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Thu, 2 Jan 2025 11:54:36 +0100
Subject: [PATCH 05/13] revert: use raw block to avoid "p"
---
.../projects/website/listing/_metadata.ejs.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/resources/projects/website/listing/_metadata.ejs.md b/src/resources/projects/website/listing/_metadata.ejs.md
index 25ad0a5700..7c26782f35 100644
--- a/src/resources/projects/website/listing/_metadata.ejs.md
+++ b/src/resources/projects/website/listing/_metadata.ejs.md
@@ -2,9 +2,9 @@
const categories = item.categories !== undefined ? item.categories.join(',') : undefined;
%>
-::: {.quarto-listing-item-metadata" style-"display:none;"}
-[]{.original-value data-original-value="${itemNumber}" style="display:none;"}
-<% if (categories !== undefined) { %>
-[]{.categories data-categories="${categories}" style="display:none;"}
-<% } %>
-:::
+```{=html}
+
+
+<% if (categories !== undefined) { %><% } %>
+
+```
From 0af2dd7a61c82cb704a8f8c031f0a6757553e5e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Canouil?=
<8896044+mcanouil@users.noreply.github.com>
Date: Thu, 2 Jan 2025 11:54:53 +0100
Subject: [PATCH 06/13] fix: typo in div code
---
src/resources/projects/website/listing/_metadata.ejs.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/resources/projects/website/listing/_metadata.ejs.md b/src/resources/projects/website/listing/_metadata.ejs.md
index 7c26782f35..725c37df0c 100644
--- a/src/resources/projects/website/listing/_metadata.ejs.md
+++ b/src/resources/projects/website/listing/_metadata.ejs.md
@@ -3,7 +3,7 @@ const categories = item.categories !== undefined ? item.categories.join(',') : u
%>
```{=html}
-
diff --git a/src/resources/projects/website/listing/_pagination.ejs.md b/src/resources/projects/website/listing/_pagination.ejs.md
index d391b4a48a..e8c89eff8c 100644
--- a/src/resources/projects/website/listing/_pagination.ejs.md
+++ b/src/resources/projects/website/listing/_pagination.ejs.md
@@ -1,8 +1,5 @@
-::: {.listing-no-matching .d-none}
-<%- listing.utilities.localizedString("listing-page-no-matches") %>
-:::
-
```{=html}
+
<%= listing.utilities.localizedString("listing-page-no-matches") %>
<% if (listing["page-size"] < items.length) { %>
+```
:::
diff --git a/src/resources/projects/website/listing/listing-table.ejs.md b/src/resources/projects/website/listing/listing-table.ejs.md
index a5d78321ac..5ce2da1a33 100644
--- a/src/resources/projects/website/listing/listing-table.ejs.md
+++ b/src/resources/projects/website/listing/listing-table.ejs.md
@@ -70,7 +70,7 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`);