I've tweaked @RyanDejaegher's code to avoid the empty space issue. First add the following to your code:
<script>
window.addEventListener('load', function () {
function removeMatchingPageFromRelatedPosts() {
var currentPath = window.location.pathname;
var matchingSummaryItem = document.querySelector(
`[href="${currentPath}"]`
);
if (!matchingSummaryItem) {
console.log('cant find matching blogpost, removing last instead')
matchingSummaryItem = document.querySelector(
'div.summary-item:last-of-type'
);
}
if (!matchingSummaryItem) return;
var summaryParent = matchingSummaryItem.closest('.summary-item');
summaryParent.remove();
console.log('matching blog post removed');
window.Squarespace.initializeLayoutBlocks(Y);
}
removeMatchingPageFromRelatedPosts();
});
</script>
Now update your Summary block to display one more item than you want, e.g. if you want to show 4 items, configure 5 to be retrieved. This code will either remove the matching post, or the last one in the list.