Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions widgets/card-list/card-list.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.card-list {
display: block;
}
display: block;
}
6 changes: 5 additions & 1 deletion widgets/card-list/card-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ export default async function decorate(widget) {
const showDescription = widget.dataset.description !== 'false';

const parentPath = resolveRoot(rootParam, lang);
const currentPath = window.location.pathname;
const index = await loadIndex(lang);
const children = index.filter((item) => isDirectChild(item.path || item.url || '', parentPath));
const children = index.filter((item) => {
const itemPath = item.path || item.url || '';
return isDirectChild(itemPath, parentPath) && itemPath !== currentPath;
});

if (children.length === 0) return;

Expand Down