Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRG-145: Support sites which use relative URLs. #37

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

eddgrant
Copy link
Contributor

@eddgrant eddgrant commented Jan 20, 2022

Presently the data returned in /api/pages.json reports all page paths as being deployed at "/", this doesn't work for sites which are deployed at a path other than "/" e.g. "/my-docs-as-code-site".

This is a companion change to alphagov/tech-docs-gem#291, which changes the content of /api/pages.json to report pages as relative paths to the /api/pages.json page. This allows tech-docs-monitor to use the site's absolute URL (which it has in config) and combine this with the relative path of each page, to build absolute an absolute URL to each page.

As far as I can tell from my testing sites which use absolute links are unaffected, so this shouldn't be a breaking change for existing users of sites deployed at "/" who want to upgrade.

This involves using the site's URL, in combination with the relative URLs returned in `/api/pages.json` and using them to build absolute an absolute URL to each page which is to be notified upon.

Sites which use absolute links are unaffected.
@eddgrant eddgrant changed the title TRG-139: Support sites which use relative URLs. TRG-145: Support sites which use relative URLs. Jan 20, 2022
@lfdebrux lfdebrux merged commit 0187eaf into alphagov:master Mar 14, 2022
@eddgrant eddgrant deleted the TRG-145 branch March 23, 2022 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants