-
Notifications
You must be signed in to change notification settings - Fork 253
redirect 'documentation/package-manager' #1125
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/jekyll/jekyll-redirect-from has a redirect_to feature as well — can we use that here?
|
@alexandersandberg I wish - that would have been lovely, but the |
|
@heckj according to their docs it should work for external links too 🤔
|
|
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. |
|
@swift-ci please test |
There was a problem hiding this 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…</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…</h1>
<a href="https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/">Click here if you are not redirected.</a>
</html>
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.