From 3830e9e4cdde49ca72f75965340020ac8c5f7cf5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 15 Feb 2022 13:29:19 -0600 Subject: [PATCH] Add RSS feed --- content/ourcraft-status.md | 26 +++++++++++++------------- layouts/index.html | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/content/ourcraft-status.md b/content/ourcraft-status.md index 928594c..5925cf4 100644 --- a/content/ourcraft-status.md +++ b/content/ourcraft-status.md @@ -71,19 +71,19 @@ function handleOnlineStatus(status) { info.style.display = 'block' document.getElementById('server-status-current-num-players').textContent = status.players.now document.getElementById('server-status-max-players').textContent = status.players.max - } - if ('sample' in status.players) { - samplingHeader.style.display = 'block' - samplingList.style.display = 'block' - samplingList.textContent = '' - for (const player of status.players.sample) { - const newListItem = document.createElement('li') - newListItem.textContent = player.name - newListItem.title = player.id - samplingList.appendChild(newListItem) - } - if (status.players.sample.length != status.players.now) { - document.getElementById('server-status-player-sampling-insufficient').style.display = 'block' + if ('sample' in status.players && status.players.now > 0) { + samplingHeader.style.display = 'block' + samplingList.style.display = 'block' + samplingList.textContent = '' + for (const player of status.players.sample) { + const newListItem = document.createElement('li') + newListItem.textContent = player.name + newListItem.title = player.id + samplingList.appendChild(newListItem) + } + if (status.players.sample.length != status.players.now) { + document.getElementById('server-status-player-sampling-insufficient').style.display = 'block' + } } } } diff --git a/layouts/index.html b/layouts/index.html index 0994445..a04ee59 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,7 +2,7 @@ {{ .Content }} -

Latest Posts

+

Latest Posts (RSS)