-
Notifications
You must be signed in to change notification settings - Fork 274
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: better paths for links #1765
Merged
juanmaguitar
merged 4 commits into
WordPress:trunk
from
juanma-wp:docs/relative-paths-links
Sep 18, 2024
Merged
Docs: better paths for links #1765
juanmaguitar
merged 4 commits into
WordPress:trunk
from
juanma-wp:docs/relative-paths-links
Sep 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
juanmaguitar
added
the
[Type] Documentation
Improvements or additions to documentation
label
Sep 14, 2024
Merged
bgrgicak
approved these changes
Sep 18, 2024
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.
I confirmed that the docs build passes and manually checked some of the links.
juanmaguitar
added a commit
that referenced
this pull request
Sep 20, 2024
## Motivation for the change, related issues As per #1720 this PR prepares the Playground Docs Site to have the docs available in different languages. ## Implementation details Under `packages/docs/site/i18n/` there should be a folder for each language. For example for `es` (Spanish) we have: ``` packages/docs/site/i18n/es ``` Under each language folder we should have a `docusaurus-plugin-content-docs/current` folder. For example for `es` (Spanish) we have: ``` packages/docs/site/i18n/es/docusaurus-plugin-content-docs/current ``` Under `docusaurus-plugin-content-docs/current` we should replicate the same structure of files of the original docs (same structure of files than under `packages/docs/site/docs`) For example for `es` (Spanish) we have just one file translated: ``` packages/docs/site/i18n/es/docusaurus-plugin-content-docs/current/main/intro.md ``` If a file is not available under a language's folder the original file in the default language will be loaded ## Testing Instructions (or ideally a Blueprint) - Change a file under one of the available languages: `packages/docs/site/i18n/{%LANGUAGE%}/docusaurus-plugin-content-docs/current` - From `/packages/docs/site` run the version for the language you'd like to test. For example to test `es`: ``` npm run dev -- --locale es ``` ## Notes When this PR is merged (due to the automatic processes to build and deploy on PR merging), there should be the following three versions of the docs in production: - https://wordpress.github.io/wordpress-playground/ - https://wordpress.github.io/wordpress-playground/es/ - https://wordpress.github.io/wordpress-playground/fr/ ### UI element to change language To give more visibility to a translated version we can uncomment the following lines at `docusaurus.config.js` ``` { type: 'localeDropdown', position: 'right', }, ``` This will generate a dropdown in the header to access directly to a language version of each file _NOTE: I recommend activating this option only when there's a fair amount of pages translaged_ ### Process to translate one page in a language The recommended process is to copy and paste the `.md` file from the original path (`packages/docs/site/docs`) into the desired language path ( `packages/docs/site/i18n/{%LANGUAGE%}/docusaurus-plugin-content-docs/current`). It is important to replicate the structure of files at `packages/docs/site/docs` The file under `packages/docs/site/i18n/{%LANGUAGE%}/docusaurus-plugin-content-docs/current` can be translated and a PR can be created with the new changes. When the PR is merged the translated version of that page should appear under https://wordpress.github.io/wordpress-playground/{%LANGUAGE%} _NOTE: Because there's a process of copying and pasting files from `packages/docs/site/docs` to the languages folder, the #1765 PR is recommended to be merged to reduce the number of errors when building the docs_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
This PR removes "wordpress-playground" from links as it's not needed, and to keep consistency with the rest of the links.
It also unifies links, removing relative paths so they start from root.
This change reduces the chance of errors when using these files for other languages (See #1766)
This PR also fixes this error when doing
npm run build:docs