Skip to content

Conversation

ebeneliason
Copy link
Contributor

This takes advantage of the Docusaurus base page parameter to avoid the redundant "/docs/…" bit of the path for every file on the docs site. All internal links are updated accordingly.

@netlify
Copy link

netlify bot commented Jan 31, 2022

✔️ Deploy Preview for pensive-meitner-faaeee ready!

🔨 Explore the source changes: 1cb16b1

🔍 Inspect the deploy log: https://app.netlify.com/sites/pensive-meitner-faaeee/deploys/61f9eb79a692010007fbc65a

😎 Browse the preview: https://deploy-preview-164--pensive-meitner-faaeee.netlify.app

@ebeneliason ebeneliason force-pushed the 1692-strip-docs-prefix branch from 2d548ff to 1cb16b1 Compare February 2, 2022 02:24
@brikis98
Copy link
Member

brikis98 commented Feb 2, 2022

Doesn't this break all existing URLs? E.g., I already shared https://docs.gruntwork.io/docs/guides/production-framework/ on social media... Can we add a redirect from /docs to /?

@eak12913
Copy link
Contributor

eak12913 commented Feb 2, 2022

I believe we can add redirects according to: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects

@ebeneliason
Copy link
Contributor Author

ebeneliason commented Feb 2, 2022

Yeah, the createRedirectsFn function looks like it would do the trick. I had thought we caught this matter early enough to not have much impact for SEO or UX, but we should go ahead and implement the redirect before we release the change. That utility will no doubt be useful in the future, too. Thanks for the callout.

@ebeneliason
Copy link
Contributor Author

ebeneliason commented Feb 2, 2022

Oh, but this is just a client side redirect. Ideally we'd do this server side with a proper 301 (permanent). We should look into configuring this on our server instead of in Docusaurus first. @eak12913 can you explore what's possible in your config?

@eak12913
Copy link
Contributor

eak12913 commented Feb 2, 2022

We've discussed this internally and we're not going to release this as-is. Instead we're going to merge this PR and then we're going to update our S3 bucket to have a routing rule according to: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html

We've already applied this rule to stage and will now test what happens after this PR gets merged to make sure there are no issue. If we're successful then we'll make a similar change to prod ahead of releasing this.

Copy link
Contributor

@eak12913 eak12913 left a comment

Choose a reason for hiding this comment

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

LGTM - merging to do a final test on stage.

@eak12913 eak12913 merged commit 59a89e1 into master Feb 2, 2022
@eak12913 eak12913 deleted the 1692-strip-docs-prefix branch February 2, 2022 18:59
@eak12913
Copy link
Contributor

eak12913 commented Feb 2, 2022

@brikis98: Update - this has been confirmed as working in stage such that: https://docs.dogfood-stage.com/docs/guides/production-framework/ will receive a 301 and redirect to the non- docs/ path.

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