Skip to content

fix: give the site a deploy, and turn link-rot findings into a report - #2

Merged
Developer1010x merged 4 commits into
mainfrom
refactor/structure
Aug 15, 2026
Merged

Developer1010x merged 4 commits into
mainfrom
refactor/structure

Conversation

@Developer1010x

Copy link
Copy Markdown
Owner

The link-rot catalogue was itself link rot

SITE.url pointed at https://knotescentral.github.io — HTTP 404 — and there was no deploy workflow at all. Every feature that referenced that URL was broken by construction.

A project whose entire pitch is "study material links quietly die, so we track them" was, itself, a dead link.

What was blocking a deploy

  • Static export was impossible until four routes were marked force-static
  • Base path was missing everywhere it has to be carried: manifest.webmanifest start_url and scope, the service-worker scope, and internal asset references
  • Open Graph images had no file extension, so a static host served all 176 of them as octet-stream and no crawler rendered a preview
  • 3 of 16 department slugs did not match their data filenames — /Maths, /MegaAccess and one more resolved to nothing

✨ Link-rot history and the /rot report

check-links.mjs now appends each run to link-history.json instead of overwriting it. That turns a snapshot into a time series: the catalogue can show whether a subject is decaying or being repaired, not just its state today.

That is the feature the project's own premise implies and never had.

Verification

  • tsc --noEmit — clean
  • production build generates all 538 static pages

Not done — deliberately

  • The site is still not live. That needs Pages enabled on the repo, which is your call, not something I should switch on.
  • 56 of 190 links are still dead. That needs actual files from students, not code. The repo now measures the gap instead of hiding it.
  • /search still ships the whole catalogue to the browser — SearchClient imports at module scope.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ZLS2PqK7vWnj38jZSxQkD

Developer1010x and others added 4 commits August 12, 2026 22:58
The catalog was a single 2926-line mockData.ts, five components were dead
code, and the dynamic routes rendered on demand. This restructures all of
it, redesigns the front end, and adds the tooling to keep the material
from silently rotting.

Structure
- Split mockData.ts into one file per department plus contributors.ts;
  verified byte-faithful (identical link/title/name counts).
- Delete the unused departmentCard -> yearSection -> semesterSection ->
  subjectSection -> noteItem subtree, the empty subjectCard, the
  all-commented links/resources.ts, and the duplicate postcss config
  (which declared a postcss-nested dependency that never existed).
- Extract shared UI (Card, TileLink, PageHeader, Badge, EmptyState,
  icons) and shared lookups (lib/catalog.ts).
- Route pages are async server components with awaited params, and every
  dynamic route prerenders via generateStaticParams: 535 static pages.
- Pin next/eslint-config-next; drop the deprecated `next export` script.

Design
- New token system: colours are RGB triplets in globals.css exposed to
  Tailwind as semantic names, so light and dark both stay correct and
  every foreground/background pair clears WCAG AA.
- Mobile-first header with a working menu, command palette on Cmd/Ctrl-K,
  breadcrumbs, empty states that say how to fix themselves, loading
  skeletons, a real 404, and per-route metadata and OG images.

Features
- Subject pages (175 of them) with their own URL, share card and metadata.
- Set-your-semester, bookmarks, revision progress, and recently viewed —
  all localStorage, no account, nothing uploaded.
- Exam-prep view: a semester's material regrouped by type.
- Contribute wizard that writes the catalog entry and opens the right
  file on GitHub, with an issue-form fallback for non-coders.
- What's New feed (dates derived from git history) plus RSS, sitemap,
  robots and JSON-LD.
- Installable PWA with offline browsing of visited pages.

Link rot
- Audited every resource link: 55 Drive folders return a hard 404 and 3
  GitHub repos are gone, because RVCE accounts are purged after students
  graduate. 30 links need an RVCE sign-in and are deliberately NOT
  flagged, since that is the healthy state for restricted material.
- Dead links are marked in place with a replacement CTA rather than
  silently failing, and subject cards show honest counts.
- check:data validates contributions, check:links re-audits, and a weekly
  workflow files the damage as an issue so this cannot go unnoticed again.
Rename
- Product name is now KnotesNeo across the UI, metadata, manifest and docs.
  Deliberately untouched: the r/KnotesCentral subreddit and the archived
  V1/V2 sites, which are real external names.

Features
- /gaps ("Help needed"): every subject whose material is entirely dead or
  missing, grouped by department, each with a prefilled "I have this"
  issue. With 56 links confirmed dead this is the list that actually
  needs volunteers, so the site notice now points here.
- Cross-department rescue: when a subject's own links are gone, the same
  course in another branch — with working links — is surfaced on the
  subject page.
- Search gained a department filter and a "hide subjects with no working
  links" toggle, on by default.
- Keyboard shortcuts: "/" to search, "g" then h/s/n/c/g to navigate,
  "?" for the shortcut list. Ignored while typing in a field.
- Theme is now light -> dark -> system, and keeps following the OS while
  set to system.
A catalogue whose stated purpose is fighting link rot was itself link rot: SITE.url
pointed at https://knotescentral.github.io, which returns 404, and no deploy
workflow existed. Nothing that referenced that URL could work.

Static export was impossible until four routes were marked force-static.
Everything that has to carry a deploy base path now does: manifest.webmanifest
start_url and scope, the service worker scope, and internal asset references.
Exported Open Graph images had no file extension, so a static host served all 176
of them as octet-stream and no crawler rendered a preview.

Department URL slugs did not match their data filenames for 3 of the 16
departments, so /Maths, /MegaAccess and one more resolved to nothing.

Feature: link-rot history and a /rot report. check-links.mjs now appends each run
to link-history.json rather than overwriting, so the catalogue can show whether a
subject is decaying or being repaired over time, instead of only its state today.

Verified: tsc --noEmit clean, and the production build generates all 538 static
pages.

Not done: the site is still not live — publishing needs a push plus Pages enabled
on the repo, which is the owner's call. 56 of 190 links remain dead; that needs
files from students, not code. The repo now measures the gap rather than hiding
it. /search still ships the whole catalogue to the browser.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZLS2PqK7vWnj38jZSxQkD
@Developer1010x
Developer1010x merged commit 76311c7 into main Aug 15, 2026
3 of 4 checks passed
Developer1010x added a commit that referenced this pull request Aug 30, 2026
main had moved on: the deploy fix (#2) and two weeks of automated
link-check commits, none of which the refactor branch had ever seen. The
branch forked before #2, so git saw most of the overlap as add/add rather
than as a shared file with two edits.

Every source conflict is the same shape — the branch's file is the newer
one and main's is the version it was derived from — so the branch wins
for all seven. The two generated link files go the other way: the bot's
24 Aug run is fresher than the 14 Aug snapshot on the branch, and the
shape is unchanged, so main's data stands.

Lint, typecheck, the 49 tests and the static export all pass on the
merged tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant