Skip to content

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
Jonty pushed a commit to uk-gov-mirror/hmcts.tech-docs-monitor that referenced this pull request Nov 10, 2025
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