-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: bake redirects from db (#3186)
- refactor: bake redirects from db - refactor: resolve internal redirects from db ### Internal redirect resolver The internal resolver is currently only used for prominent links. The following query reveals some examples of where it might be used: ``` select * from posts_links pl join posts p on pl.sourceId = p.id where pl.linkType = 'grapher' and componentType = 'prominent-link' and p.status = 'publish' and p.gdocSuccessorId is NULL and pl.target in ( select slug from chart_slug_redirects csr ) ``` For instance, in https://ourworldindata.org/ukraine-war ![Screenshot 2024-02-10 at 09.10.18.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/0SFFiIjKuUK6UPYHVe6u/f120f2fc-5e01-4eb2-9990-050ddd0827f8.png) ### formatWpUrl refactor This PR also simplifies the formatWpUrl function since none of the paths in redirects contain the "__" string: ``` SELECT url, action_data, action_code FROM wp_redirection_items WHERE (url like "%\_\_%" OR action_data like "%\_\_%") and status = "enabled" ``` --> 0 results
- Loading branch information
Showing
2 changed files
with
17 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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