website: add a GitHub social button to the site's header

This commit is contained in:
Adorian Doran
2025-10-03 19:09:23 +03:00
parent 30f530abdb
commit 7657e17373
4 changed files with 47 additions and 13 deletions

View File

@@ -0,0 +1,15 @@
const API_URL = "https://api.github.com/repos/TriliumNext/Trilium";
/** Returns the number of stargazers of the Trilium's GitHub repository. */
export async function getRepoStargazersCount() {
const response = await fetch(API_URL);
if (response.ok) {
const details = await response.json();
if ("stargazers_count" in details) {
return details["stargazers_count"];
}
}
return 31862; // The count as of 2025-10-03
}