Using GitHub Pages
Docusaurus was designed to work well with one of the most popular hosting solutions
for open source projects: GitHub Pages.
Deploying to GitHub Pages
1. Docusaurus supports deploying as project pages or user/organization pages, your code repository
does not even need to be public.
Even if your repository is private, anything published to a gh-pages branch will be public.
Note: When you deploy as user/organization page, the publish script will deploy these
sites to the root of the master branch of the [Link] repo. In this case, note
that you will want to have the Docusaurus infra, your docs, etc. either in another branch
of the [Link] repo (e.g., maybe call it source), or in another, separate repo
(e.g. in the same as the documented source code).
2. You will need to modify the file website/[Link] and add the required parameters.
Name Description
organizationNam The GitHub user or organization that owns the repository. If you are the owner, then it is your GitH
e username. In the case of Docusaurus, that would be the "facebook" GitHub organization.
The name of the GitHub repository for your project. For example, the source code for Docusaurus
projectName
hosted at [Link] so our project name, in this case, would be
"docusaurus".
url Your website's URL. For projects hosted on GitHub pages, this will be "[Link]
Base URL for your project. For projects hosted on GitHub pages, it follows the format "/projectNa
baseUrl
For [Link]
const siteConfig = {
...
url: '[Link] // Your website URL
baseUrl: '/testProject/',
projectName: 'testProject',
organizationName: 'userName'
...
}
Copy
In case you want to deploy as a user or organization site, specify the project name
as <username>.[Link] or <orgname>.[Link]. E.g. If your GitHub username is "user42"
then [Link], or in the case of an organization name of "org123", it will
be [Link].