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

docs: add redirects for docs IA update #388

Merged
merged 13 commits into from Jan 15, 2023
Merged

Conversation

bpmutter
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

Redirects for docs site as part of the information architecture overhaul.

Should be merged together with eslint/eslint#16665

What changes did you make? (Give an overview)

Added redirects for new docs information architecture.

Related Issues

eslint/eslint#16665

Is there anything you'd like reviewers to focus on?

Note: created some helper scripts in this repo - https://github.com/bpmutter/eslint-redirects

This can (but doesn't have to be) used to make any bulk changes to the additions here.

@netlify
Copy link

netlify bot commented Dec 17, 2022

👷 Deploy request for es-eslint pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7a95a3d

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for new-eslint ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/63b312973ea3a90008ab0476
😎 Deploy Preview https://deploy-preview-388--new-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@eslint-github-bot eslint-github-bot bot added triage documentation Improvements or additions to documentation labels Dec 17, 2022
@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/zh-hans-eslint/deploys/63b312970c10b50009c8bbf3
😎 Deploy Preview https://deploy-preview-388--zh-hans-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/63b31297c89ee200088257a4
😎 Deploy Preview https://deploy-preview-388--fr-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@bpmutter bpmutter marked this pull request as draft December 17, 2022 21:14
@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/63b312972223c90009b84d9f
😎 Deploy Preview https://deploy-preview-388--hi-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/63b31297ac594a000854fafb
😎 Deploy Preview https://deploy-preview-388--ja-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/de-eslint/deploys/63b3129740ca0c00086228d2
😎 Deploy Preview https://deploy-preview-388--de-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Dec 17, 2022

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 7a95a3d
🔍 Latest deploy log https://app.netlify.com/sites/pt-br-eslint/deploys/63b31297149d2c00085286c4
😎 Deploy Preview https://deploy-preview-388--pt-br-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

src/static/redirects.njk Outdated Show resolved Hide resolved
@bpmutter bpmutter marked this pull request as ready for review December 21, 2022 02:50
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

This doesn't seem to work. For example, https://deploy-preview-388--new-eslint.netlify.app/docs/latest/user-guide/ does not redirect to https://deploy-preview-388--new-eslint.netlify.app/docs/latest/use/

Perhaps the new redirect rules should be before this one so that the new rules match first:

# Regular Docs
/docs/latest/* https://{{ site.locals.docs_latest }}/:splat 200!

https://docs.netlify.com/routing/redirects/#rule-processing-order

@bpmutter
Copy link
Contributor Author

This doesn't seem to work. For example, https://deploy-preview-388--new-eslint.netlify.app/docs/latest/user-guide/ does not redirect to https://deploy-preview-388--new-eslint.netlify.app/docs/latest/use/

Perhaps the new redirect rules should be before this one so that the new rules match first:

# Regular Docs
/docs/latest/* https://{{ site.locals.docs_latest }}/:splat 200!

https://docs.netlify.com/routing/redirects/#rule-processing-order

didn't realize that there was a staging site that redirects would work on here. thx for call out. will play around w that for testing

nzakas
nzakas previously requested changes Dec 28, 2022
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

I did a spot-check of a few links and they appear to redirect correctly now. Just a bit of cleanup with regards to splatted URLs.

src/static/redirects.njk Outdated Show resolved Hide resolved
@bpmutter
Copy link
Contributor Author

This doesn't seem to work. For example, https://deploy-preview-388--new-eslint.netlify.app/docs/latest/user-guide/ does not redirect to https://deploy-preview-388--new-eslint.netlify.app/docs/latest/use/
Perhaps the new redirect rules should be before this one so that the new rules match first:

# Regular Docs
/docs/latest/* https://{{ site.locals.docs_latest }}/:splat 200!

https://docs.netlify.com/routing/redirects/#rule-processing-order

didn't realize that there was a staging site that redirects would work on here. thx for call out. will play around w that for testing

ok, implemented the suggested change, and it's working as expected. using example above, now https://deploy-preview-388--new-eslint.netlify.app/docs/latest/user-guide/ redirects to https://deploy-preview-388--new-eslint.netlify.app/docs/latest/use/

it also captures the splat patterns such as https://deploy-preview-388--new-eslint.netlify.app/docs/latest/user-guide/page-does-not-exist to <https://deploy-preview-388--new-eslint.netlify.app/docs/latest/use/page-does-not-exist


with that being said, there's a lot of conditional logic going on in this file that i don't fully understand, so it'd be great if this could be reviewed taking that into account.

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
@nzakas
Copy link
Member

nzakas commented Dec 28, 2022

The conditional logic is primarily for the various translation sites, only one of which (zh-hans.eslint.org) has its own docs.

Although that does remind me: when we are renaming files, we need to make sure to do it for the zh-hans docs as well or else everything will break.

@bpmutter
Copy link
Contributor Author

The conditional logic is primarily for the various translation sites, only one of which (zh-hans.eslint.org) has its own docs.

Although that does remind me: when we are renaming files, we need to make sure to do it for the zh-hans docs as well or else everything will break.

ok, how do you think is best to proceed with this?

i don't know chinese so am probably not too useful with that.

src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
src/static/redirects.njk Outdated Show resolved Hide resolved
bpmutter and others added 2 commits December 28, 2022 16:24
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@mdjermanovic
Copy link
Member

For the start, we could add these redirects only for the English site. Once zh-hans.eslint.org is ready for this change, we can remove the condition.

@mdjermanovic
Copy link
Member

/docs/latest/developer-guide/code-conventions should be redirected to /docs/latest/contribute/code-conventions.

@mdjermanovic
Copy link
Member

/docs/latest/developer-guide/package-json-conventions should be redirected to /docs/latest/contribute/package-json-conventions

@mdjermanovic
Copy link
Member

/docs/latest/developer-guide/working-with-rules-deprecated should be redirected to /docs/latest/extend/custom-rules-deprecated.

@mdjermanovic
Copy link
Member

If we'd like to enable these redirects only for the English site (eslint.org), we can wrap them in {% if site.language.code == "en" %}...{% endif %}.

bpmutter and others added 2 commits December 30, 2022 11:49
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@bpmutter
Copy link
Contributor Author

If we'd like to enable these redirects only for the English site (eslint.org), we can wrap them in {% if site.language.code == "en" %}...{% endif %}.

@mdjermanovic would you mind putting suggestions for this change on the PR?

i don't fully understand what's going on with conditionals statements for the redirects

@bpmutter
Copy link
Contributor Author

@mdjermanovic thank you again for a thorough review. added the above suggested redirects and also went through the all file moves in the eslint/eslint#16665 and added some redirects that were covered by the splat to be explicit in f5e151a

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

@mdjermanovic would you mind putting suggestions for this change on the PR

Here it is

src/static/redirects.njk Show resolved Hide resolved
src/static/redirects.njk Show resolved Hide resolved
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@nzakas
Copy link
Member

nzakas commented Jan 2, 2023

If we are doing this just for the English site now, then maybe we should put these into the English site file instead?
https://github.com/eslint/eslint.org/blob/main/src/_data/sites/en.yml#L23-L29

I've been trying to avoid checking the language of the site inside of other files.

@mdjermanovic
Copy link
Member

If we are doing this just for the English site now, then maybe we should put these into the English site file instead? https://github.com/eslint/eslint.org/blob/main/src/_data/sites/en.yml#L23-L29

I've been trying to avoid checking the language of the site inside of other files.

I think it would be easier to leave this here, as it's only temporary. Once we update the zh-hans docs site too, we can just remove the condition.

@nzakas
Copy link
Member

nzakas commented Jan 11, 2023

Sounds good 👍

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

This should be merged right after the release that includes eslint/eslint#16665

@btmills btmills dismissed nzakas’s stale review January 15, 2023 04:19

Feedback appears to have been addressed, and this PR needs to be merged after the release.

@btmills btmills merged commit a35a4e0 into eslint:main Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants