Skip to content
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

Add redirects for relocated topics #43

Closed
infotexture opened this issue Nov 19, 2017 · 3 comments
Closed

Add redirects for relocated topics #43

infotexture opened this issue Nov 19, 2017 · 3 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@infotexture
Copy link
Member

With the new top-level structure of the documentation for dita-ot/docs#121, the file system locations of many topics will change between 3.0 & 3.0.1 when dita-ot/docs#185 is merged with the hotfix/3.0.1 branch.

Although few deep links to 3.0 topics are likely to have been shared so soon after the initial release, several have already been sent via email and other channels, so redirects should be set up to automatically load (at least these) topics from their new locations.

GitHub Pages does not support redirecting via server configuration files such as .htaccess or .conf, but recent versions of the gem do support redirects via the jekyll-redirect-from plugin, which serves HTML files with an HTTP-REFRESH meta tag that points to the new destination.

As the name suggests, the plugin’s default usage is to add redirect_from metadata to the YAML header of files that should answer to alternative URLs, so the file that includes these entries is loaded instead. This approach is less useful in our case, where files are auto-generated from a common layout template, so individual overrides are less practical.

However, the plugin also supports a lesser-known redirect_to mode that can be used to set up (otherwise empty) pages at the old location with a YAML front-matter block that points to the new location:

---
# Redirect from old permalink
layout: base
title: Moved to new location…
redirect_to:
  - /3.0/topics/migration.html
---

I have verified this approach in local testing, and plan to roll out the changes with the 3.0.1 hotfix.

@infotexture infotexture added the feature New feature or request label Nov 19, 2017
@infotexture infotexture added this to the 3.0.1 milestone Nov 19, 2017
@infotexture infotexture self-assigned this Nov 19, 2017
@infotexture
Copy link
Member Author

Still need to verify which 3.0 URLs have been shared thus far and set up the redirects for these files.

I don’t think it’s necessary to set up redirects for every relocated topic, so will check analytics data and forums for clues on which URLs need to be redirected.

@infotexture
Copy link
Member Author

infotexture commented Nov 19, 2017

The following 3.0 URLs have been publicly shared and will need to be redirected for 3.0.1:

@infotexture
Copy link
Member Author

infotexture commented Nov 19, 2017

The changes will of course also affect paths in the dev docs.

While these are by nature more volatile and never promised to be stable, we might consider redirecting a few dev URLs that have been recently shared or receive above-average traffic, such as:

infotexture added a commit to infotexture/dita-ot-staging that referenced this issue Nov 30, 2017
infotexture added a commit to infotexture/dita-ot-staging that referenced this issue Nov 30, 2017
Add 3.0 redirects for dita-ot#43

Built from commits:
* dita-ot/docs@9dcb95b0 (hotfix/3.0.1)
* dita-ot/dita-ot@35e7b7cf3 (hotfix/3.0.1)
* dita-ot/org.dita-ot.html@c0ccd2f (master)

Signed-off-by: Roger Sheen <roger@infotexture.net>
infotexture added a commit to infotexture/dita-ot-staging that referenced this issue Nov 30, 2017
* hotfix/3.0.1:
  Update ‘3.0’ docs for 3.0.1
  Update {{site.version}} & link to previous version
  Enable redirects (dita-ot#43)
infotexture added a commit that referenced this issue Nov 30, 2017
* hotfix/3.0.1:
  Implement review feedback from @robander
  Update ‘3.0’ docs for 3.0.1
  Update {{site.version}} & link to previous version
  Enable redirects (#43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant