Skip to content

Commit 1d907c6

Browse files
committed
Update freeze following category listing changes in v1.6
quarto-dev/quarto-cli#11177 solved an issue which required a new version of .js script for listing. This changes requires an update in freezer to reflect the changes in the category listing. This is done by rendering incrementaly one of the post. (cherry picked from commit 3e945a2)
1 parent 4f35989 commit 1d907c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

_freeze/site_libs/quarto-listing/quarto-listing.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const kProgressiveAttr = "data-src";
22
let categoriesLoaded = false;
33

44
window.quartoListingCategory = (category) => {
5+
category = atob(category);
56
if (categoriesLoaded) {
67
activateCategory(category);
78
setCategoryHash(category);
@@ -58,7 +59,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
5859
);
5960

6061
for (const categoryEl of categoryEls) {
61-
const category = categoryEl.getAttribute("data-category");
62+
const category = atob(categoryEl.getAttribute("data-category"));
6263
categoryEl.onclick = () => {
6364
activateCategory(category);
6465
setCategoryHash(category);
@@ -208,7 +209,7 @@ function activateCategory(category) {
208209

209210
// Activate this category
210211
const categoryEl = window.document.querySelector(
211-
`.quarto-listing-category .category[data-category='${category}'`
212+
`.quarto-listing-category .category[data-category='${btoa(category)}']`
212213
);
213214
if (categoryEl) {
214215
categoryEl.classList.add("active");
@@ -231,7 +232,7 @@ function filterListingCategory(category) {
231232
list.filter(function (item) {
232233
const itemValues = item.values();
233234
if (itemValues.categories !== null) {
234-
const categories = itemValues.categories.split(",");
235+
const categories = atob(itemValues.categories).split(",");
235236
return categories.includes(category);
236237
} else {
237238
return false;

0 commit comments

Comments
 (0)