Version: 1.14.6
Publish the Site
Next, we'll learn how to publish the site to the WWW for everyone to browse! For the purpose of the tutorial, we'll use GitHub pages to host our website. But you can use any static file hosting service that you want, e.g. Netlify, Amazon S3, etc.
#
Put the Site OnlineKill the web server first by pressing Cmd + C or Ctrl + C depending on your operating system.
In website/siteConfig.js
, fill in the following fields:
- In the
website
directory, runnpm run build
oryarn build
. This will generate abuild
directory inside thewebsite
directory containing the.html
files from all of your docs and other pages included inpages
. Make sure thebuild
directory is there before running the next step. - Replace
<GIT_USER>
with your GitHub username and run the following command.
The built code will be pushed to the gh-pages
branch of your repository.
- Go to
https://USERNAME.github.io/docusaurus-tutorial/
and view your site in action!
Note that when you run
npm run start
again, thebaseUrl
will now be part of the path.