mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-19 11:03:32 +00:00
12 lines
392 B
JavaScript
12 lines
392 B
JavaScript
insertNavigationBar("All News");
|
|
|
|
function main(json) {
|
|
// Set tab title
|
|
document.title = `News - ${json.name}`;
|
|
|
|
// Sort news by latest
|
|
json.news.sort((a, b) => (new Date(b.date)).valueOf() - (new Date(a.date)).valueOf());
|
|
|
|
// Create & insert news items
|
|
json.news.forEach(news => document.getElementById("news").insertAdjacentHTML("beforeend", newsItemHTML(news)));
|
|
} |