Skip to content

chore: migrate site to unvtd.unece.org

Ashley HARWOOD requested to merge chore/migrate-site-to-unvtd-unece-org into main

This MR reconfigures the site to serve its content and static assets from the root path instead of the nested /unece/uncefact/spec-unvtd/ base path, and re-homes all published URLs to https://unvtd.unece.org.

The unvtd.unece.org subdomain is already configured against GitLab Pages and is already routing. However, the site was intentionally built without GitLab's unique-domain option so it could live at the unambiguous namespace URL https://un.opensource.unicc.org/unece/uncefact/spec-unvtd/, which requires serving content and assets from that nested base path. When the same build is accessed through the custom domain, the pages look for their assets beneath that nested path rather than at the root of the domain, so the assets return 404 and the site is effectively broken at unvtd.unece.org today. With the current configuration only one URL structure can work correctly at a time.

The agreed approach for all UNECE projects on GitLab is to enable the unique-domain setting and serve each site from the root path, as already done for AgriFood (https://un.opensource.unicc.org/unece/uncefact/untp-agrifood/ and https://agrifood.untp.unece.org/). GitLab then redirects the old namespace URL to the generated unique domain, and both the unique domain and unvtd.unece.org load the site correctly. This MR is the repository half of that change:

  • next.config.mjs drops basePath and assetPrefix so the static export serves from the root
  • hardcoded /unece/uncefact/spec-unvtd prefixes are removed from the layout, the render page, the fetching components, and MDX asset references
  • every published schema, context, and example URL is rewritten to https://unvtd.unece.org
  • the two links to the sibling GRID project point at https://grid.unece.org/ (it is moving at the same time), and the home page naming is aligned from GTR to GRID
  • links to this GitLab repository are unchanged, because only the published site is moving

The @context and credentialSchema.id const values in the published schemas change to the new host. This is a clean cutover. A credential shaped with the old URLs will not validate against the re-homed schemas, and HTTP redirects cannot change exact-string validation. Just note, all in-repo examples are synthetic and have been updated. If production credentials have been issued against the old schema and context URLs, they will fail validation against the re-homed schemas and will require re-issuance against the new URLs.

This MR just needs to be approved; I will take it from there.

Test plan

  • npm run build static export succeeds with root-relative assets
  • 506 schema-compliance tests pass
  • 127 LD link-resolution tests pass against the live unvtd.unece.org
  • Browser smoke of the local export: home, KTDDE compliance, LD status, and render pages all fetch from root with no errors
  • No references to the old site URL remain in the source tree

Merge request reports

Loading