Skip to content

Show paper citation counts; add the Paper Surveys type - #96

Merged
bits-bytes-nn merged 2 commits into
mainfrom
paper-citations
Oct 13, 2026
Merged

bits-bytes-nn merged 2 commits into
mainfrom
paper-citations

Conversation

@bits-bytes-nn

Copy link
Copy Markdown
Owner

Adds a live citation count to paper posts and a new Paper Surveys post type.

Citation count

  • New optional front-matter key paper_doi (paper types only). js/citations.js calls the Semantic Scholar Graph API from the browser: arXiv:<id> for 10.48550/arXiv.<id>, DOI:<doi> otherwise.
  • The count shows as a "Citations" field at the end of the post meta panel and links to the paper on Semantic Scholar.
  • Results are cached per DOI in localStorage for 24h. On 429, network error or the 5s timeout, the last value is shown or the field stays hidden; there are no retries. A count of 0 and a not-found (404) result are hidden too.
  • No number is baked into the HTML.
  • No CSP exists, so there is nothing to update.

Backfill

  • paper_doi was filled on 28 paper posts (every Paper Reviews / Paper Summaries post), from the source paper's arXiv link: the first entry under References, matched against the title, with the version stripped. The key sits right under paper_author.
  • Skipped: 0.
  • The one-off script was run and not committed.
  • Known gaps on Semantic Scholar: Gemini 1 (2312.11805) is not found by arXiv ID, and DeepSeek-V3 (2412.19437) resolves to a duplicate record with 0 citations. Both posts show no field.

Paper Surveys

  • A new type for posts that trace one topic through several papers in publication order.
  • It has its own /paper-surveys/ page (empty state for now) and a nav tab.
  • Seven tabs wrapped the 48em bar, so tabs use a short nav_title (Summaries / Reviews / Surveys) and desktop link padding is 1.1em. The footer site map keeps the full titles.

scholar-lens

Changed keys in _data/post_conventions.yml:

  • types.Paper Surveys: {} (new)
  • the types comment, which describes paper_doi and Paper Surveys

The scholar-lens copy needs the same change before its drift check passes.

New lint rule in script/lint-posts.rb: on a paper type, paper_doi must be a bare DOI; on any other type it is an error.

Passes:

  • "10.48550/arXiv.2310.06825"
  • "10.18653/v1/2024.acl-long.1"

Fails:

  • "https://doi.org/10.48550/arXiv.2310.06825"
  • "arXiv:2310.06825"
  • ""
  • 10.48550
  • "10.1000/a?b"
  • "10.1000/a#b"
  • any paper_doi on Tech Guides, Insights or Paper Surveys

Verification

  • tests: 174 runs, 0 failures
  • lint: 35 posts follow the conventions
  • strict build, htmlproofer and validate-site.sh all pass
  • Playwright, with the API mocked: a 200 response, a reload within 24h (no request), 429 with and without a stale cache, a blocked request, the 5s timeout, light and dark themes, 360–1440px, print, and the aria snapshot
  • Two adversarial review rounds (code/tests/docs and UI/UX). Round 2 found 0 MAJOR issues.
  • One real API call returned 11,027 for DPO.

Paper posts take an optional paper_doi (paper types only, a bare DOI;
the lint checks both). js/citations.js fetches the count in the browser,
caches it for a day, and hides the meta-panel field on failure or zero.
All 28 paper posts are backfilled from their source arXiv link.
Seven tabs wrapped the 48em nav bar, so tabs take a shorter nav_title
(Summaries, Reviews, Surveys) and desktop link padding drops to 1.1em;
the footer site map keeps the full titles.
@bits-bytes-nn
bits-bytes-nn merged commit ea6ee73 into main Oct 13, 2026
3 checks passed
@bits-bytes-nn
bits-bytes-nn deleted the paper-citations branch October 15, 2026 11:30
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