Skip to content

Conversation

@heckj
Copy link
Member

@heckj heckj commented Aug 1, 2025

removes existing content at /documentation/package-manager, preserving the URL location and explicitly redirecting to https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/, the hosted site for the updated Package Manager documentation.

@heckj heckj requested a review from a team as a code owner August 1, 2025 20:50
@heckj heckj changed the title redirect 'documentation/package-manager' to 'https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/' redirect 'documentation/package-manager' Aug 1, 2025
@heckj heckj self-assigned this Aug 1, 2025
Copy link
Member

@alexandersandberg alexandersandberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heckj
Copy link
Member Author

heckj commented Aug 4, 2025

@alexandersandberg I wish - that would have been lovely, but the redirectTo: plugin only works to transfer to pages within the Jekyll site, not to external links, hence the HTML redirect shenanigans...

@alexandersandberg
Copy link
Member

@heckj according to their docs it should work for external links too 🤔

Sometimes, you may want to redirect a site page to a totally different website. This plugin also supports that with the redirect_to key:

@heckj
Copy link
Member Author

heckj commented Aug 4, 2025

Well, that definitely seems to work as well - I just re-tried it. I thought I'd read in earlier docs that it wouldn't with external content, but I'm glad I was wrong! I'll amend this PR to include that explicitly, leaving the HTML for a backup that we hopefully will never need.

@heckj
Copy link
Member Author

heckj commented Aug 4, 2025

@swift-ci please test

Copy link
Member

@alexandersandberg alexandersandberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave the additional content on the page, but it is overwritten by the redirect plugin when building the website. The resulting html file looks like this:

<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting&hellip;</title>
  <link rel="canonical" href="https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/">
  <script>location="https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/"</script>
  <meta http-equiv="refresh" content="0; url=https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/">
  <meta name="robots" content="noindex">
  <h1>Redirecting&hellip;</h1>
  <a href="https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/">Click here if you are not redirected.</a>
</html>

@heckj heckj merged commit b24d31a into swiftlang:main Aug 5, 2025
3 checks passed
@heckj heckj deleted the swift-package-redirect branch August 5, 2025 22:27
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.

3 participants