fix: link books to Open Library and Google Books, not only Open Library #2

Merged
jfro merged 1 commit from jtk/book-lookup-links into main 2026-10-18 15:52:16 +00:00
Owner

Fixes GitHub #28 (old mirror): the book page only linked to Open Library, which is a dead end for books that came from Google Books, Hardcover, LoC, or were entered by hand.

What changed

  • The book page's "OpenLibrary" row is now Find online, with links to Open Library and Google Books by ISBN (ISBN-13 preferred, ISBN-10 fallback). No ISBN, no row.
  • BookLookup.google_books_url/1 and BookLookup.external_links/1; openlibrary_url/1 shares ISBN cleanup (keeps a trailing X, ignores junk).
  • External links get rel="noopener noreferrer".
  • No external calls added; the links are built locally.

Tests

  • Doctests + unit tests for the URL helpers (new book_lookup_test.exs).
  • Controller tests for the show page with and without an ISBN.
  • mix precommit: 160 passed.
Fixes GitHub #28 (old mirror): the book page only linked to Open Library, which is a dead end for books that came from Google Books, Hardcover, LoC, or were entered by hand. **What changed** - The book page's "OpenLibrary" row is now **Find online**, with links to Open Library and Google Books by ISBN (ISBN-13 preferred, ISBN-10 fallback). No ISBN, no row. - `BookLookup.google_books_url/1` and `BookLookup.external_links/1`; `openlibrary_url/1` shares ISBN cleanup (keeps a trailing X, ignores junk). - External links get `rel="noopener noreferrer"`. - No external calls added; the links are built locally. **Tests** - Doctests + unit tests for the URL helpers (new `book_lookup_test.exs`). - Controller tests for the show page with and without an ISBN. - `mix precommit`: 160 passed.
fix: link books to Open Library and Google Books, not only Open Library
All checks were successful
CI / test (pull_request) Successful in 35s
b9bc4853c8
A book can come from any metadata provider, so the Open Library link alone
was often a dead end (GitHub #28). The book page now offers each catalog
that can be linked by ISBN, with rel=noopener on the external links.
Author
Owner

Review from Nye (approved) — clean_isbn handles nil/blank/lowercase x, ISBN-13 preferred over 10, rel=noopener added, tests + doctests cover it. No other callers of openlibrary_url broke.

**Review from Nye (approved)** — clean_isbn handles nil/blank/lowercase x, ISBN-13 preferred over 10, rel=noopener added, tests + doctests cover it. No other callers of openlibrary_url broke.
jfro merged commit 882ea519ac into main 2026-10-18 15:52:16 +00:00
jfro deleted branch jtk/book-lookup-links 2026-10-18 15:52:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/fuzzy_catalog!2
No description provided.