Website: v1.3.7 screenshots, WebP delivery, social card, skip link, idle API lookups

- Screenshots retaken from the v1.3.7 demo build (the old set still showed the
  pre-1.3.3 workout screen with its button rows). The five phone images are now
  served through <picture> as WebP at 600/1170 px with the PNG as fallback; the
  hero image is preloaded. website/build-images.sh produces img/ from assets/.
- og:image on every page is a 1200×630 card (assets/social.jpg) with width,
  height and alt; robots meta with max-image-preview:large; preconnect to the
  analytics host; SoftwareApplication JSON-LD carries version, dates,
  screenshots and a feature list.
- Every page starts with a Skip-to-content link and the content sits in
  <main id="main">; scroll reveals are also disabled for print.
- The GitHub and Discord counters wait for requestIdleCallback instead of
  racing the hero image. Cache-bust ?v=18. llms.txt names GitHub as the home.
- robots.txt, sitemap.xml and llms.txt now live in website/ so the site is
  fully regenerable from the repo.
This commit is contained in:
Duarte Santos committed 2026-09-13 13:13:02 +02:00
1 parent d7f0f0dbdb
commit 975c9f440b
18 files changed
+164 -44

No files matched your search

+7 -4
View File
@@ -10,6 +10,9 @@ const GH_REPO = 'https://api.github.com/repos/DuarteSantos8/openGym'
// Origin, so the browser is allowed to read it. The code is the permanent invite in the
// nav; if that invite is ever revoked this returns 404 and the count simply stays blank.
const DC_INVITE = 'https://discord.com/api/v10/invites/e62jY6fwVb?with_counts=1'
// The two network lookups below are decoration; they wait until the page is idle so they
// never compete with the stylesheet, the hero image or the demo frame.
const whenIdle = (fn) => ('requestIdleCallback' in window ? requestIdleCallback(fn, { timeout: 2500 }) : setTimeout(fn, 1200))
/* ------------------------------------------------------- one panel controller
The navigation sheet and the contents drawer are the same object with different
@@ -232,7 +235,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {
The cache keys carry a _gh2 suffix: a visitor with a still-warm entry from the GitLab
weeks would otherwise be read with the old field names and show NaN. */
;(async () => {
;whenIdle(async () => {
const set = (id, v) => document.querySelectorAll('[data-gh="' + id + '"]').forEach(el => { el.textContent = v })
try {
let d = null
@@ -253,13 +256,13 @@ function panel({ opener, panelEl, flag, closeBtn }) {
// Leave the placeholder standing rather than writing an empty box.
if (d.open_issues_count !== '' && d.open_issues_count != null) set('issues-n', d.open_issues_count)
} catch (e) { /* offline / rate-limited — leave placeholders */ }
})()
})
/* --------------------------------------------------- Discord members (nav + specs)
Same shape as the repo counts above, and just as optional: the placeholder next to
the Discord link is empty, so a blocked or rate-limited request leaves the link
reading exactly as it did before anyone counted anything. */
;(async () => {
;whenIdle(async () => {
const set = (id, v) => document.querySelectorAll('[data-dc="' + id + '"]').forEach(el => { el.textContent = v })
try {
let n = null
@@ -278,7 +281,7 @@ function panel({ opener, panelEl, flag, closeBtn }) {
set('members', fmt)
set('members-n', fmt)
} catch (e) { /* offline / blocked — the link keeps its plain label */ }
})()
})
/* -------------------------------------------------------------- about timeline
Built from the published GitHub releases, so the page updates itself with every