document.addEventListener('DOMContentLoaded', function() {
const posts = document.querySelectorAll('article.post');
posts.forEach(post => {
const link = post.querySelector('h2.entry-title a');
if (link) {
post.style.cursor = 'pointer';
post.addEventListener('click', () => {
window.location.href = link.href;
});
// Prevent nested links from triggering the event twice
const nestedLinks = post.querySelectorAll('a');
nestedLinks.forEach(nestedLink => {
nestedLink.addEventListener('click', e => {
e.stopPropagation();
});
});
}
});
});