diff --git a/src/resources/projects/website/listing/_filter.ejs.md b/src/resources/projects/website/listing/_filter.ejs.md index c72ec41fad..2f2948c46a 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) { %>
- - " + aria-label="<%= listing.utilities.localizedString("listing-page-order-by") %>" onChange="window['quarto-listings']['listing-<%- listing.id %>'].sort(this.options[this.selectedIndex].value, { order: this.options[this.selectedIndex].getAttribute('data-direction')})" > - - - <% for (const sortData of sortableFields) { %> - - <% } %> - + + + <% for (const sortData of sortableFields) { %> + + <% } %> +
- - <% } %> - <% if (filterUi) { %>
- " /> + " />
<% } %> diff --git a/src/resources/projects/website/listing/_metadata.ejs.md b/src/resources/projects/website/listing/_metadata.ejs.md index 45d19c4a7e..725c37df0c 100644 --- a/src/resources/projects/website/listing/_metadata.ejs.md +++ b/src/resources/projects/website/listing/_metadata.ejs.md @@ -2,7 +2,9 @@ const categories = item.categories !== undefined ? item.categories.join(',') : undefined; %> -
+```{=html} + +``` diff --git a/src/resources/projects/website/listing/_pagination.ejs.md b/src/resources/projects/website/listing/_pagination.ejs.md index 046b3f0818..e8c89eff8c 100644 --- a/src/resources/projects/website/listing/_pagination.ejs.md +++ b/src/resources/projects/website/listing/_pagination.ejs.md @@ -1,8 +1,8 @@ -
<%- listing.utilities.localizedString("listing-page-no-matches")%>
-<% if (listing["page-size"] < items.length) { %> ```{=html} +
<%= listing.utilities.localizedString("listing-page-no-matches") %>
+<% if (listing["page-size"] < items.length) { %> -``` <% } %> +``` diff --git a/src/resources/projects/website/listing/item-default.ejs.md b/src/resources/projects/website/listing/item-default.ejs.md index edaebc664f..91114a7867 100644 --- a/src/resources/projects/website/listing/item-default.ejs.md +++ b/src/resources/projects/website/listing/item-default.ejs.md @@ -31,44 +31,94 @@ return value; let value = readField(item, field); if (value !== undefined) { -print(`
${listing.utilities.outputLink(item, field, value)}
`); +print(`
${listing.utilities.outputLink(item, field, value)}
`); } } %> -
> +::: {.quarto-post .image-<%= imageAlign %> <%= listing.utilities.metadataAttrs(item) %>} + <% if (fields.includes('image')) { %> - +``` + <% } %> -
+ +::: {.body} + <% if (fields.includes('title')) { %>

<%= item.title %>

+<% if (fields.includes('subtitle')) { %> <% } %> -<% if (fields.includes('categories') && item.categories) { %> +<% } %> + +<% if (fields.includes('categories') && item.categories) { %> + +```{=html}
<% for (const category of item.categories) { %> -
<%= category %>
+
<%= category %>
<% } %>
-<% } %> +``` + +<% } %> + <% if (fields.includes('description')) { %> - + +```{=html} + +``` + <% } %> -
- +<% outputMetadata(item, field) %> +<% } %> -
+```{=html} + +``` + +::: + +::: diff --git a/src/resources/projects/website/listing/item-grid.ejs.md b/src/resources/projects/website/listing/item-grid.ejs.md index a584349734..e19307988d 100644 --- a/src/resources/projects/website/listing/item-grid.ejs.md +++ b/src/resources/projects/website/listing/item-grid.ejs.md @@ -37,83 +37,151 @@ return !["title", "image", "image-alt", "date", "author", "subtitle", "descripti }); %> -
> +::: {.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']) %>

+``` + <% } else { %> + +```{=html} <%= listing.utilities.imgPlaceholder(listing.id, itemNumber, item.outputHref) %> -<% } %> +``` <% } %> +<% } %> + <% 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'] %>
<% } %> +::: {.card-body .post-contents} + +<% if (showField('title')) { %> +
<%= item.title %>
+<% } %> + +<% if (showField('subtitle')) { %> +
<%= item.subtitle %>
+<% } %> + +<% if (showField('reading-time')) { %> + +```{=html} +
<%= item['reading-time'] %>
+``` + +<% } %> <% if (fields.includes('categories') && item.categories) { %> +```{=html}
- <% for (const category of item.categories) { %> -
<%= category %>
- <% } %> +<% for (const category of item.categories) { %> +
<%= category %>
+<% } %>
+``` <% } %> + <% if (showField('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')) { %> +
<%= item.author %>
+<% } %> + +<% if (showField('date')) { %> +
<%= item.date %>
+<% } %> + +```{=html}
+``` + <% } %> <% if (otherFields.length > 0) { %> +```{=html} -<% for (const field of otherFields) { -let value = readField(item, field); +<% for (const field of otherFields) { +let value = readField(item, field); %> +``` + - + + +```{=html} <% } %>
<%= listing.utilities.fieldName(field) %><%= listing.utilities.outputLink(item, field, value) %><%= listing.utilities.outputLink(item, field, value) %>
+``` <% } %> -
+::: <% } %> <% if (fields.includes('filename') || fields.includes('file-modified')) { %> - + +::: <% } %> -
+ +```{=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..d45de6ccf9 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}`); <% for (const field of fields) { %> -<% if (sortUi && hasSort(field)) { %><% } %><%= listing.utilities.fieldName(field) %><% if (sortUi && hasSort(field)) { %><% } %> +<% if (sortUi && hasSort(field)) { %><% } %><%= listing.utilities.fieldName(field) %><% if (sortUi && hasSort(field)) { %><% } %> <% } %> @@ -82,13 +82,16 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`); %> <%= onclick(item) %>> +``` + <% for (const field of fields){ %> - -<%= outputValue(itemNumber, field) %> - +<%= outputValue(itemNumber, field) %> <% } %> + +```{=html} + <% } %> -``` \ No newline at end of file +``` diff --git a/tests/docs/listings/_quarto.yml b/tests/docs/listings/_quarto.yml index ab4e3f6657..d6fd0887a0 100644 --- a/tests/docs/listings/_quarto.yml +++ b/tests/docs/listings/_quarto.yml @@ -5,4 +5,4 @@ website: title: "Listing Test" format: html: - theme: [litera, styles.scss] \ No newline at end of file + theme: [litera]