website/: den Stand nachgezogen, der seit dem GitHub-Ausfall live ist

Die Seite auf opengym.duarte-santos.ch wurde am Ausfalltag direkt im dist bearbeitet,
die Quelle hier blieb auf dem alten Stand: GitHub-Links, GitHub-API fuer die Zaehler,
Demo-iframe auf die tote Pages-Instanz.

Uebernommen: Hinweisblock zur Sperre auf allen drei Seiten, Links und Zaehler auf
gitea.com (site.js liest jetzt stars_count/open_issues_count und die Releases von
dort), Discord-Abschnitt, Demo-Sektion als "Temporarily offline" mit Verweis auf APK
und Selfhosting, dazu die neuen Styles und der Umami-Tag der Website.

Die Zeitleiste auf about.html fuellt sich, sobald hier Releases stehen - die
Release-API von gitea.com liefert aktuell noch nichts.
This commit is contained in:
Duarte Santos committed 2026-08-22 13:56:26 +02:00
1 parent f94fa7c0e3
commit c588d219ba
6 files changed
+218 -47

No files matched your search

+12 -11
View File
@@ -1,25 +1,26 @@
// Live GitHub numbers in the nav + open-source strip. Fails silently — the site
// works fine without them (unauthenticated API: 60 req/h per IP, cached below).
// Live repo numbers in the nav + open-source strip. Fails silently — the site works
// fine without them. Points at the gitea.com mirror while the GitHub account is
// suspended; switch the two API URLs back to api.github.com once it is restored.
(async () => {
const set = (id, v) => document.querySelectorAll('[data-gh="' + id + '"]').forEach(el => { el.textContent = v })
try {
let d = null
const cached = sessionStorage.getItem('gh_repo')
const cached = sessionStorage.getItem('repo_meta')
if (cached) d = JSON.parse(cached)
else {
const r = await fetch('https://api.github.com/repos/DuarteSantos8/openGym')
const r = await fetch('https://gitea.com/api/v1/repos/DuarteSantos/openGym')
if (!r.ok) return
d = await r.json()
sessionStorage.setItem('gh_repo', JSON.stringify({ stargazers_count: d.stargazers_count, forks_count: d.forks_count, open_issues_count: d.open_issues_count }))
sessionStorage.setItem('repo_meta', JSON.stringify({ stars_count: d.stars_count, forks_count: d.forks_count, open_issues_count: d.open_issues_count }))
}
set('stars', '★ ' + d.stargazers_count)
set('stars-n', d.stargazers_count)
set('stars', '★ ' + d.stars_count)
set('stars-n', d.stars_count)
set('forks-n', d.forks_count)
set('issues-n', d.open_issues_count)
} catch (e) { /* offline / rate-limited — leave placeholders */ }
})()
// About page: build the milestones timeline from the published GitHub releases, so the
// About page: build the milestones timeline from the published Gitea releases, so the
// page updates itself with every release. The static entries marked data-fallback stay
// in place when the API is unreachable; the hand-written first entry is always kept.
;(async () => {
@@ -27,14 +28,14 @@
if (!tl) return
try {
let rel = null
const cached = sessionStorage.getItem('gh_releases')
const cached = sessionStorage.getItem('repo_releases')
if (cached) rel = JSON.parse(cached)
else {
const r = await fetch('https://api.github.com/repos/DuarteSantos8/openGym/releases?per_page=100')
const r = await fetch('https://gitea.com/api/v1/repos/DuarteSantos/openGym/releases?limit=100')
if (!r.ok) return
rel = (await r.json()).filter(x => !x.draft && !x.prerelease)
.map(x => ({ tag: x.tag_name, name: x.name, at: x.published_at, body: x.body || '', url: x.html_url }))
sessionStorage.setItem('gh_releases', JSON.stringify(rel))
sessionStorage.setItem('repo_releases', JSON.stringify(rel))
}
if (!rel.length) return
const fmt = d => new Date(d).toLocaleDateString('en-GB', { year: 'numeric', month: 'long', day: 'numeric' })