-
Notifications
You must be signed in to change notification settings - Fork 5
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
Handle URL extension routes with redirects #1005
Conversation
✅ Deploy Preview for documentcloud-frontend-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Coverage Report
File Coverage
|
url = documents.pdfUrl(document); | ||
return redirect(302, url); | ||
|
||
// fallback: redirect to the canonical path, on the same host |
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.
This is a great approach! My only design question is whether .txt
should redirect to the text mode in an embed viewer instead of the full-site viewer.
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.
Historically, there wasn't a difference between embed and normal versions of the viewer (except in the very beginning), but the .html
extension is baked into the WordPress plugin (by me, a long time ago, sorry) so it's still used in embeds.
This is the old documentation: https://web.archive.org/web/20180301171441/https://www.documentcloud.org/help/publishing#linking
All that said, I don't have much evidence of anyone using the .txt.
or .pdf
links, and it hasn't been supported in a few years, so I think we're ok like this, and we can adjust if needed.
Closes #997 and #56
Test on this document: https://deploy-preview-1005.muckcloud.com/documents/20006908-lawsuit-document-dkt-1-68-ex-j/