Skip to content

Commit 134ea9b

Browse files
committed
listing - link activation for categories should work on any window.location
It requires to strip any query search or hash part from the URL before comparing it to the link retrieved in listings' items.
1 parent 3cfdf01 commit 134ea9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/resources/formats/html/quarto.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
225225
}
226226

227227
async function findAndActivateCategories() {
228-
const currentPagePath = offsetAbsoluteUrl(window.location.href);
228+
// Categories search with listing only use path without query
229+
const currentPagePath = offsetAbsoluteUrl(
230+
window.location.origin + window.location.pathname
231+
);
229232
const response = await fetch(offsetRelativeUrl("listings.json"));
230233
if (response.status == 200) {
231234
return response.json().then(function (listingPaths) {

0 commit comments

Comments
 (0)