Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ First install [`pre-commit`](https://repology.org/project/python:pre-commit/vers
The website is using [Jekyll](https://jekyllrb.com/) static website generator and [Github pages](https://pages.github.com/).
To run and develop it locally you need to install [`rbenv`](rbenv.org) using `apt install rbenv ruby-build`.
Then use `rbenv init` and follow the instructions to set it up.

rbenv was built specifically for Unix-like environments. So windows users can install rbenv through WSL 2.

Run in PowerShell

```bash
wsl --install
```

Open the Ubuntu terminal and run `apt install rbenv ruby-build` .Then use `rbenv init` and follow the instructions mentioned below to set it up.

With `rbenv` installed and activated in your shell:

```bash
Expand Down
4 changes: 3 additions & 1 deletion js/news-collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ document.addEventListener("DOMContentLoaded", async function () {
const data = await response.json();
let topics = data.topics || [];

if (!topics.length) throw new Error("No topics found");
if (topics.length === 0) {
throw new Error("No news topics found in the JSON data.");
}

topics.sort((a, b) => new Date(b.created_at || b.last_posted_at) - new Date(a.created_at || a.last_posted_at));
loadingText.style.display = "none";
Expand Down