Skip to content

Link each question to related ones, and check the built site - #26

Merged
alxkm merged 1 commit into
masterfrom
related-questions
Oct 24, 2026
Merged

alxkm merged 1 commit into
masterfrom
related-questions

Conversation

@alxkm

@alxkm alxkm commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Each question page ended at "previous" and "next", which are neighbours by number, not by subject.

Related questions. The build picks up to four per question by shared tags:

  • a tag weighs by how rare it is (IDF), so sharing varhandle counts for more than sharing executors;
  • tags that name a kind of question (basics, theory, design, api, puzzle) are ignored, after "What is a deadlock?" turned out related to "process vs thread" through basics;
  • the same topic only breaks ties; previous and next are excluded, being linked already.

171 of 180 questions get some, 3.6 on average. Examples: the deadlock question links to the Coffman conditions, the transfer deadlock, diagnosing one, and tryLock with a timeout; the singleton question to both double-checked locking questions. Shown on question pages and inside an opened card on the front page (in-page links there).

The build checks its output and fails on a broken internal link (2,457 checked across all pages), HTML escaped twice anywhere including questions.json (the #18 bug class), or a question page without a title, heading or description. Verified by injecting a broken link and < into a page: the build failed and reported both.

  • ./gradlew test passes
  • node build.mjs passes its checks; looked at a question page and an opened card in Chrome

Each question page ended at "previous" and "next", which are neighbours
by number, not by subject. The build now picks up to four related
questions by the tags they share, weighting a tag by how rare it is
(IDF) so "varhandle" outweighs "executors", ignoring tags that name a
kind of question rather than a subject (basics, theory, design, api,
puzzle), and using the same topic only to break ties. 171 of 180
questions get some; the rest have their only close matches as the
previous or next question, which are linked already.

They show on the question pages and in an opened card on the front
page, where they link within the page.

The build then checks what it wrote and fails on a broken internal link
(2,457 checked), HTML escaped twice anywhere including questions.json,
or a question page without a title, heading or description. Injecting a
broken link and a double-escaped entity into a page fails the build
with both reported.
@alxkm
alxkm merged commit 903d9f1 into master Oct 24, 2026
5 checks passed
@alxkm
alxkm deleted the related-questions branch October 24, 2026 11:57
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