layout | title |
---|---|
default |
Home |
Don't expect too much, please...
View on GitHubVisit on YouTube
Failed to load ${feed.source} feed.
`; } } } // Sort by date allItems.sort((a, b) => b.pubDate - a.pubDate); // Display the first page displayPage(currentPage); } function displayPage(page) { const feedContainer = document.getElementById('rss-feed'); feedContainer.innerHTML = ''; // Clear current content // Calculate the items to display on the current page const start = (page - 1) * itemsPerPage; const end = page * itemsPerPage; const itemsToShow = allItems.slice(start, end); if (itemsToShow.length) { itemsToShow.forEach(item => { const feedItem = document.createElement('div'); feedItem.innerHTML = `