Closed chachasikes closed 2 years ago
Hey @aaronhans - Can you update us on the status of this system? What tasks are remaining?
Completed:
Remaining:
Open ticket assigned to @wrendo to help prioritize the how will we synch wordpress and git repo redirect set here: https://github.com/cagov/cagov-design-system-headless-wordpress/issues/3
This is a duplicate of https://github.com/cagov/cagov-design-system-headless-wordpress/issues/3 Closing & archiving
Never mind, reopening!
Thanks for volunteering to publicly expose the endpoints that let us retrieve the list of existing redirects @chachasikes
We can use this ticket for that work:
Plugin's REST documentation: https://redirection.me/developer/rest-api/
Endpoints we need to hit without authenticating:
https://live-drought-ca-gov.pantheonsite.io/wp-json/redirection/v1/export/1/json or https://live-drought-ca-gov.pantheonsite.io/wp-json/redirection/v1/export/1/csv
I'll complete the additions to wordpress-to-github and the headless repo on the https://github.com/cagov/cagov-design-system-headless-wordpress/issues/3 ticket
@aaronhans It turns out I'm already working on cagov/wordpress-to-github#50. The PR is at cagov/wordpress-to-github#91. See this comment for details.
(pre-merged example: https://github.com/cagov/drought.ca.gov/blob/odi-engineering-32/restore-redirects/src/redirects/assign.js)
Updates on this:
I will try to expose get the JSON (not CSV as discussed yesterday on Slack) - it will align with the other work we are doing. (The plugin extension I need to write extends a package that was designed for AJAX API usage & isn't directly exposable without changing permissions in the wrong way, but I think I can create an extension.
ISSUE: There are some structural issues with the way the plugin is constructed that lower my confidence in success here, but I came up with an idea yesterday to load the main class & create our own endpoint with the data using their pattern and adding a new role.
The redirection plugin keeps track of slug changes, not system wide WordPress changes.
Is duplicate of #56
Closing this one & keeping one main thread for redirects.
Sort our redirection capabilities & decide on data structure desired by headless pipeline.
See if we can expose redirection plugin data to headless in order to give a redirection UI to site admins from wordpress for additional redirects not accommodated by page renames. (Also check how redirection captures page slug renames)
Note: Aaron did some work on this already