This commit is contained in:
allexanderbergmns
2026-08-26 18:42:44 +02:00
parent 03616cd150
commit ac7a7ff35d
8 changed files with 49 additions and 43 deletions
+9 -13
View File
@@ -47,20 +47,9 @@
<p>ReviveSparc is released under the BSD 2-Clause License.</p>
</div>
<script type="text/json" id="news-data">[
{
"date": "2026-06-15",
"title": "ReviveSparc Initial Development",
"body": "The project has officially started. We are currently in the research phase, working hard to make this work.",
"link": "index.html",
"linkText": "Read More"
}
]</script>
<script>
function renderNews() {
function renderNews(entries) {
var container = document.getElementById("news-container");
var entries = JSON.parse(document.getElementById("news-data").textContent);
var html = "";
entries.forEach(function (e) {
html += '<div class="news-item">';
@@ -79,7 +68,14 @@ function renderNews() {
});
container.innerHTML = html;
}
renderNews();
fetch("news.json")
.then(function (response) { return response.json(); })
.then(renderNews)
.catch(function () {
document.getElementById("news-container").innerHTML =
'<p class="meta">Failed to load news.</p>';
});
</script>
</body>