Deploying the Documentation
Welcome to the final part of this tutorial! If you're here, then you're done with the complex part of this documentation process, and you can relax your shoulders. It is assumed that you are done making changes to the documentation you created, and all that's left is to deploy it for your users to access.
In this part, we will guide you through the deployment process and how to configure your project for deployment. Let's get started and make your documentation available to the world!
Building and deploying the documentation website
Before deploying your documentation, you need to build the static files that will be served to your users. Follow these steps to build:
Open your command-line interface (CLI) and navigate to the root directory of your Docusaurus project.
Run the build command,
Once you're done building the documentation, the next step is to deploy it. Here are some free deployment options you should consider:
Configuring deployment options
This involves setting up the necessary configurations that will connect your project to a hosting platform. GitHub Pages provides a free option for hosting your Docusaurus documentation. To deploy to GitHub Pages, follow these steps:
Ensure your project is a Git repository and hosted on GitHub.
docusaurus.config.jsfile in the root directory of your project.
baseUrlfields in the
urlfield to the URL where your documentation will be hosted (e.g.,
baseUrlfield to the repository name of your project (e.g.,
Commit and push the changes to your GitHub repository.
Navigate to the repository's settings on GitHub and scroll down to the GitHub Pages section.
Select the branch you want to deploy (typically
release) and save the configuration. Your Docusaurus documentation will now be accessible at the specified URL.
Whether you choose GitHub Pages, Netlify, or another hosting platform, ensure that your configurations align with the specific requirements of the chosen deployment option.
If you frequently update your documentation, consider enabling continuous deployment. This feature, which is available on platforms like Netlify and Vercel, automatically rebuilds and deploys your documentation whenever you push changes to your repository.
Congratulations on making it to the end of this tutorial! By now, your documentation website should be deployed and accessible to its users.
Throughout this tutorial, we covered various aspects of getting started with Docusaurus as a beginner in technical writing. We explored the entire process of documenting with Docusaurus. With this knowledge contained in this tutorial, you should be able to create professional and user-friendly documentation for your next project, as well as comfortably contribute to Open Source projects built with Docusaurus. Best of luck in your future technical writing endeavors!