owid-grapher
owid-grapher copied to clipboard
Include embedded charts redirects in content graph
Core problem
Charts embedded in articles are added to the content graph. However, when the chart URL has since then been updated (and is now redirected in the browser), that chart reference is skipped (thanks @marcelgerber for surfacing this).
article ◄─── broken ─── outdated chart URL
reference in article text
Proposed solution
Resolve the internal redirect server-side in order to find the chart associated with the outdated chart URL and create the back-reference in the content graph.
┌───────────────────────────────────────────┐
│ │
article ◄─── chart ◄────┼──── canonical ◄──── outdated chart URL │
│ chart URL in article text │
│ │
│ │
│ resolveInternalRedirect() │
└───────────────────────────────────────────┘
Alternatives
Saving all chart_slug_redirects
in the content graph: does not take into consideration chart redirects defined in Wordpress. It also wouldn't handle grapher -> explorer redirects down the line, when explorers make it into the content graph.
Context
See also #1148
tagging as "nice to have" as the content graph only powers the "All our related research and data" block" at the moment but will become "important" when we expand its reach, making it a more central piece of our categorization system (#1070), at which point we'll probably also have to persist it (#1223).
Suggest closing this one and focusing on #1223 and trying to solve this issue when we implement the persisting
@danyx23 ok, I've added a more visible reference to it in #https://github.com/owid/owid-grapher/issues/1223 to not lose track of the context
This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.