(function() { var script = document.currentScript; var token = script.getAttribute('data-api'); var apiUrl = script.src + '_fetch/' + token; var container = script.parentElement; if(!token || !container) { console.error('API token is missing or container element not found.'); return; } fetch(apiUrl) .then(response => response.text()) .then(html => { container.innerHTML = html; }) .catch(error => { console.error('Error fetching latest posts:', error); container.innerHTML = '

Unable to load latest posts.

'; }); })();