Added: dynamic Open Graph/Twitter metadata for saved results#418
Open
mnot wants to merge 1 commit into
Open
Conversation
Saved result pages now emit per-result og:title, og:description, og:url and Twitter summary-card tags so that sharing a /saved/ link unfurls into a meaningful preview (tested URI plus a problem/warning roll-up) instead of the generic site card. The metadata is derived only for saved results, where the full resource (and its notes) is available when the <head> is rendered; live tests are still fetching at that point, so they keep the static site metadata. The roll-up counts BAD/WARN notes for single results; descend results get a generic "resource and its embedded resources" description. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Saved result pages (
/saved/{id}) now emit per-resultog:title,og:description,og:url, and Twitter summary-card tags, so sharing a saved link unfurls into a meaningful preview (tested URI + a problem/warning roll-up) instead of the generic site card.Approach
<head>renders. Live tests are still fetching at that point, so they keep the static site metadata.social_meta()helper inhtml_base.pybuilds the values; the OG block inresponse_start.htmlis now conditional and addstwitter:card/title/description, withog:urlpointing at the saved permalink.BAD/WARNroll-up (e.g. "1 problem, 2 warnings found by REDbot's HTTP checks."); clean results say "No problems found…"; descend results get a generic "resource and its embedded resources" description (detected viaresource.descend, since the saved-load path doesn't pass adescendkw).og:imageis unchanged (static logo) — no per-result image exists.Verification
Ran a local daemon and confirmed all three paths against real checks:
make typecheckandmake lintclean (pylint 10.00/10, j2lint passes).🤖 AI-generated by Claude (Opus 4.8). Design, the link-preview mockup, and the local end-to-end verification were reviewed by @mnot; the human author reviewed before merge.