Refactor project paths and handling, preserve query params, scope download/XML routes, and adapt template for canonical URLs#462
Open
cycomachead wants to merge 1 commit into
Open
Conversation
- Change project show route to /users/:username/projects/:projectname. - Add 301 redirects for legacy /project query parameter URLs. - Update project models to use /api/v1/ for download and XML routes. - Add support for canonical link tags using the primary domain. - Update client-side path generation to match new URL structure. Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor project routes to use canonical URL paths and scope API endpoints
This PR cleans up project URL handling by introducing a proper RESTful path for project pages, adding 301 redirects from legacy URLs, and emitting canonical link tags to ensure search engines always index the primary domain.
Changes
/project?username=...&projectname=...→/users/:username/projects/:projectnameas the canonical project show routeGET /projectwith query params (including olduser/projectaliases) now issues a 301 redirect to the new path, preserving all parametersself.canonical_urlusingconfig.hostname(the primary domain), andviews/layout/head.etluaemits a<link rel="canonical">tag when present — ensuring secondary-domain requests still point canonically at the primary domainurl_for('site')now returns the new/users/{username}/projects/{projectname}path;url_for('download')now returns/api/v1/project/{id}Cloud.prototype.showProjectPathupdated to produce the new URL structure usingencodeURIComponentapi.luaunchanged: Theproject/:idroute remains accessible viaapi_route(both/api/v1/project/:idand/project/:id) — no breaking change to the APIReviewer Notes
api.luaroute was intentionally not changed to hard-scope under/api/v1/— that change was reverted per feedback. The model's download URL now emits the namespaced form, but the legacy short path remains supported server-side./projectGET handler normalizes the olduser/projectparam aliases and lowercases usernames to match the globalbefore_filterbehavior.Superconductor Ticket Implementation | App Preview | Guided Review