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
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.
Enable `docs-only` mode by setting `get-started/introduction` as the starting
point by setting its `slug` to `/` (page can be changed in
`scripts/tasks/add-frontmatter.js`).
In order to work correctly in production, the output path and `baseUrl` are
updated to `/docs/latest/`. If we add versioning this might need to change.
It also deletes previous homepage and makes sure that documents that are not
needed are not copied.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ref: https://docusaurus.io/docs/docs-introduction#docs-only-modeClose#47
Co-authored-by: Antón Molleda <amolleda@gmail.com>
This commit adds support to respond to `repository_dispatch` events
coming from `electron/electron-website-updater` that contain the
SHA of the new commit in `electron/electron` to pin to in
`package.json`.
More information about the architecture can be found in #19.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#19Close#23
Add the top navigation link "Examples" and a new page that explains how
to acquire Fiddle and run the examples available in the sidebar.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Close#26
Partial work on #2
Co-authored-by: Erick Zhao <erick@hotmail.ca>
With the update to .75 the titles are hidden and `hide_title` has to be
disabled. It was enabled initially because otherwise titles were
duplicated (one from frontmatter, the other from the markdown).
Enables CI via GitHub actions. Additionally it uses the action
`bahmutov/npm-install` to reduce the process of installing
dependencies by ~40%.
- - - - - - - - - - - - - - - - - - - -
Close#25
Use `json5` to `stringify` the content of `sidebars` so it can be read
as a regular JS object instead of a JSON one.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#15Close#16
This PR allows developers to pass a parameter to indicate where in the
file system the `prebuild` script should look for the documentation. It
assumes it is a clone of `electron/electron` so the content should be
under a `/docs` folder. E.g.:
```console
yarn prebuild ../electron
```
In the future there might be a `watch` option enabled by default. This
is the MVP for #4.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#4Close#9
This change makes sure that `sidebars.js` is not generated from scratch
each time that `prebuild` is called:
- New content is added at the end of the corresponding category or in
a new one if it does not exist.
- If no new content is found, `sidebars.js` is left unmodified.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#8
The documentation in `electron/electron` uses the current format to
embed a fiddle:
```
```javascript fiddle='docs/fiddles/screen/fit-screen'
```
The new fiddle remark plugin uses:
```
```fiddle docs/fiddles/example
```
This PR updates all the old style to use the new one.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ref https://github.com/electron/electronjs.org-new/pull/5
The pre-build scripts does the following:
1. Downloads the documentation from electron/electron and data/blog
from electron/electronjs.org
2. Moves the files to the right folders based on the contents of
`docs-reorg.json`
3. Add frontmatter to each file
4. Fixes internal links and multiline image titles
5. Generates the sidebar using the folder structure
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fix#6
Ref: Solves parts of #2