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

chore: docs versioning and i18n #1527

Merged
merged 16 commits into from
Mar 21, 2024
Merged

chore: docs versioning and i18n #1527

merged 16 commits into from
Mar 21, 2024

Conversation

pd93
Copy link
Member

@pd93 pd93 commented Mar 3, 2024

This PR solves a couple of issues with documentation versioning and internationalisation.

The problems:

  1. When we make changes to our docs, it updates the website immediately.
  2. Our i18n translations are stored in the Git repository
    • This encourages users to make changes to other languages via Git (This should be done via Crowdin)
    • Automatically generated "sync crowdin" PRs need to be constantly reviewed and merged
    • Its a lot of duplication in the repository
    • It creates a lot of changes when used in conjunction with versioning (see solution for problem 1)

The solutions:

  1. We could theoretically avoid deploying the website until we cut a new release (this was proposed in chore: deploy docs only when a new version is released #1525). However, this means that the docs for our "next" version are not very discoverable and it's more difficult to spot errors before a release is cut. A better solution is to use Docusaurus's built-in versioning functionality to create two versions of our documentation:
  • latest: Represents the latest released version of Task and will only be updated when a release is made. This will be the default when opening our website
  • next: Represents all the tip of our main branch and contains all the latest changes. Users would have to explicitly select "Next 🚧" from the versions drop-down on the website to view this. Docusaurus also automatically adds a banner to the top of every page warning users that this functionality has not been released.

This PR also updates the release tool so that the "latest" version is automatically updated when a maintainer create a new release.

  1. The solution to this is simple. Remove and gitignore the docs/i18n folder and remove the sync-translated-documents workflow from the repository. Instead, we should update the command that Netlify runs when it builds the documentation to pull the translations from Crowdin. This is how the Docusaurus documentation actually suggests this should be done.

Note that this PR puts in place all the changes required for this to work (I think?). However, the command will need updating in Netlify to actually apply this change, otherwise the site will be deployed without any translations. The command will need updating to npx crowdin download && npx docusaurus build

  • chore: remove all translations
  • chore: remove sync crowdin workflow
  • chore: gitignore i18n directories
  • chore: add crowdin:sync script to package.json
  • feat: add "latest" version
  • feat: update release tool to update latest doc version
  • fix: logo in next/intro docs and spacing

@pd93 pd93 force-pushed the docs-versioning-and-i18n branch from ab4d6bf to a442020 Compare March 4, 2024 18:27
@andreynering
Copy link
Member

@pd93 Awesome work! Thanks for taking the time to do these improvements.

I have two small details to discuss:

  1. We have this bug where depending on the width of the browser window, we have too little space for all that stuff on the top bar. This already happens on our current site, but got a little worse with yet another menu on the top bar.
Screenshot 2024-03-10 at 11 06 47

We don't necessarily need to fix on this PR (can be in another one), but I would consider 1) make these social network links into icon-only links (the Docusaurus website itself does this); or 2) Remove Twitter, Mastodon and Discord and keep only GitHub (and perhaps Discord) which is/are the most important.

  1. How will Crowdin / translations work with the next website? Should we remove this language menu for Next?
Screenshot 2024-03-10 at 11 13 55

@pd93
Copy link
Member Author

pd93 commented Mar 10, 2024

  1. We have this bug where depending on the width of the browser window, we have too little space for all that stuff on the top bar. This already happens on our current site, but got a little worse with yet another menu on the top bar.

I had noticed this, but was going to raise another issue/discussion as there are a few things we could do to improve the navbar. I generally agree with your first choice of moving towards icons instead of text links. There are also some other things I had considered:

  • We also have some things duplicated in the sidebar and top bar. We could probably keep this as Docs, Blog and Donate
  • Remove the Donate page from the docs and make it its own proper page.
  • Move the docs under the /docs path (we could create some temporary redirects in Netlify to aid migration. On second thoughts, I don't think this is necessary.
  • Unrelated, but I'd like to consider renaming the top level docs folder in the repo to website as the website encompasses more than just documentation now. This follows the structure in Docusaurus' own repo. The docs/docs hierarchy also stutters a bit.

Screenshot of all these changes:

image

Wdyt about these icons?

  1. How will Crowdin / translations work with the next website? Should we remove this language menu for Next?

My understanding is that it should just work? But I'm not entirely sure. If we want to test it, we can do a deployment to a staging site on this PR with the new command

@pd93 pd93 force-pushed the docs-versioning-and-i18n branch from f27e0ff to 86c733d Compare March 10, 2024 21:24
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

The site is looking great, thanks!

I'd just change the icons to be in the following order (most important first): GitHub, Discord, Twitter, Mastodon.

Unrelated, but I'd like to consider renaming the top level docs folder in the repo to website as the website encompasses more than just documentation now. This follows the structure in Docusaurus' own repo. The docs/docs hierarchy also stutters a bit.

It looks like a good idea to me!

pd93 added 16 commits March 21, 2024 00:52

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison

Verified

This commit was signed with the committer’s verified signature.
pd93 Pete Davison
@pd93 pd93 force-pushed the docs-versioning-and-i18n branch from bb0e0de to 8323179 Compare March 21, 2024 00:57
@pd93 pd93 merged commit f006930 into main Mar 21, 2024
13 checks passed
@pd93 pd93 deleted the docs-versioning-and-i18n branch March 21, 2024 01:04
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.

None yet

2 participants