Repository navigation
Store hotlinked arXiv figures; seo_title for long titles; search tests - #139
Merged
Merged
Conversation
…, test search in node - 122 arXiv figures that 18 older posts still hotlinked are stored as assets/images/<slug>-<n>.<ext>, with scholar-lens's own ImageLocalizer (its names, ar5iv-placeholder and SVG handling); only image URLs change. They now get width/height, and no longer rot when arXiv renumbers. Other sites' images stay links, as scholar-lens leaves them. - Lint: an arXiv image URL is rejected (store it); a title over the new spec key seo_title_max_length (70, scholar-lens's existing limit) needs a seo_title, held to the same limit. Seven posts get one. - js/search.js exports its pure functions under node; test/js/ covers ranking, pair dedupe, escaping and excerpts (node --test, no packages), and CI runs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR carries out three of the decisions left open after #138: storing hotlinked figures, requiring
seo_titlefor long titles, and testing the search script. The other three are not done; the reasons are at the end.1. Hotlinked arXiv figures are now stored
Eighteen older posts (19 files, counting the ko/en pair) still hotlinked 122 figures from arXiv. Those images had no width/height, so the page jumped as they loaded, and the links break whenever arXiv renumbers a revision.
I stored them with scholar-lens's own
ImageLocalizer, run from itsmain(0bccf60), so they get the generator's names (assets/images/<slug>-<n>.<ext>) and its handling of ar5iv placeholders and SVGs. Only image URLs changed in the posts: 131 lines changed and 131 replaced, each only in thesrc. Images from other sites (AWS, Medium, Databricks and others, 25 in all) stay links, as scholar-lens leaves them, because they belong to their owners. The repo grows by about 42 MB (117 files).Hand fixes to generated posts (regenerating a paper would produce the same files):
/assets/images/<slug>-<n>.png.2.
seo_titlefor long titles_data/post_conventions.ymlchange: new keyseo_title_max_length: 70. scholar-lens already reads this field and uses 70 as its default, so its behaviour does not change. A scholar-lens PR syncs its copy of the file.New lint rules (
script/lint-posts.rb):seo_title_max_lengthneeds aseo_title, and theseo_titleis held to the same limit. This matches scholar-lens'svalidation.pycheck.seo_title; a 71-characterseo_title.seo_title: "Short".,<img src="https://www.arxiv.org/x.png">./assets/images/mistral-7b-1.png; a CloudFront image (it belongs to its owner); a link[the paper](https://arxiv.org/abs/…); an image inside a code fence.arxiv.org/html.Hand fixes:
seo_titlewas added to 7 posts whose titles run 73–93 characters. Each newseo_titleis 34–68 characters:3. Search tests
js/search.jsnow exports its pure functions (ranking, pair dedupe, excerpts, markup) when loaded in node.test/js/search.test.jshas 9 tests and runs withnode --test test/js/, with no packages to install. CI runs it after the Ruby tests. Two mutation checks confirmed the tests catch a broken pair rule and a broken title weight.Not done
validation.py, and that file has someone else's uncommitted work in progress. The value is low and the change would collide with that work.dateModified: it needs either a new front-matter key in the generator or the full git history in CI, and the impact is low.default*.jpgcovers: kept. scholar-lens'sDEFAULT_COVERusesdefault.jpg.Verification
validate-site.shall pass.