Skips single-word Electron events because these can be common words we
want to translate such as `closed` or `quit`.gcb
Orthogonal bugfix: also uses `continue` to skip loop iterations rather
than `return`.
Use the version number instead of `Current` in the versions drop down as
well as its title when visiting the latest documentation. Previous
branches only have a link to the most up-to-date docs to avoid getting
stale.
This also removes the pre-commit hook to avoid issues adding new
versions to translate (which is unnecessary).
The `.gitignore` was too aggressive and new files under `docs/latest`
weren't added. Now we ignore the `vXX-y-z` folders.
Also tweaked the `sidebars.js` creation process so new tutorials are
added under `How To` instead of creating a new section.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rel #95
The way versioned documents are supported on the site differs a bit from
Docusaurus' documentation:
- Each doc change to a branch is build and publish separately.
- The links to the versions are `_blank` to bypass `react-router` even
though the content is in the same server. The reason is that because
it is built at different steps it is not "found".
This is achieve thanks to `electron-website-updater` sending a
`repository_dispatch` event with 2 different types of actions for each
`push` event that happens in `electron/electron` that contains doc
changes. The 2 types of events are:
* `doc_changes_branches`: Updates to documentation branches (does not
matter if they are the latest or not).
* `doc_changes`: Updates to the latest stable branch.
The tasks to perform are almost identical and are split in two different
GitHub actions for each event:
1. Download the markdown for the SHA, check if there are new version
branches and update `versions-info.json`, update the SHA, and publish
those changes to Git.
This is done in `update-docs-XXX.yml` when we receive the event.
2. Build the content for that branch and publish in the right place.
This is done in `push-XXX.yml` when there is a push to `main` or a
`vXX` branch.
The deployment is done to the storage service. The difference is that a
branch will only push `assets` and `docs` while `main` will publish
everything.
Additionally, Crowdin gets updated every time there is a change in
`main` to make sure the latest content is always uploaded.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#118
Integrates with Crowdin to enable i18n of the site. This PR changes the
source of truth for Crowdin and moves it to this repository instead of
relying on `electron/i18n`.
Additionally it uses Crowdin's CLI to do the upload/download of assets
making it more reliable.
The website is built on locale at a time via `yarn i18n:build`.
Otherwise the process crashed with an out of memory error. The regular
`yarn build` command still compiles the `en` locale.
Because we cannot get notifications when there are new translations
avaiable, there is a GitHub workflow (`update-i18n-deploy.yml`) that
downloads the content every few minutes, builds, and deploy. To speed up
this process, the previous generated assets are download. In local tests
this reduces the build times from 250s to 40s so the whole process
should take about 5 minutes.
The previous generated content is stored in Azure Storage. Because this
is a static website it makes more sense than having a dyno and will make
it easier to:
- deploy multiple locales at the same time if we still need to speed up
the process
- have versioned docs because we just need to "take a snapshot" and
publish to a different folder
The current live site is still not using this storage but will soon-ish.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#64
Because `docs` is now tracked, the logic to decide when to push changes
or create a new PR has changed. This code searches now for new files
instead of just checking if `package.json` has been modified.
This bug was discovered via https://github.com/electron/electronjs.org-new/pull/113
The locale `i18n/en-US` is used by `electron/i18n` as the source to
translate content into other locales and avoid having to manually create
the different JSON files or keep them in sync.
Once those files are translated, they will be downloaded and put in
the right place for each locale. This will happen in an upcoming PR.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Close#67
Rel: #64
We trim the final string output in this transformation, which inadvertently resets all
leading whitespace and flattens all Markdown lists in the API docs.
This PR uses `trimEnd()` instead of `trim()` to only remove trailing whitespace instead.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Close#57
If a page has the same name as the folder where it is, it will become
the landing page for that section. E.g.: `/security/security.md` will be
available via `/security` instead of `/security`.
Also add the sections `Performance` and `Security` to the footer
navigation to increase awareness.