To set up Github sync for your documentation, you’ll first need a repository configured to work with our Hashode app on GitHub. You can use our documentation template as a starting point by cloning or forking it, then customize it to suit your needs. With the Hashnode CLI, you can manage your documentation directly from the terminal easily, spotting errors, verifying local changes, and previewing your content.
Install Hashnode App
Once you have setup your repository, the next step is to install the Hashnode app to your docs repository on GitHub.
1. Navigate to your documentation dashboard settings and to the Github tab and click on the “Install Hashnode app” button.
2. Install the Hashnode app to your GitHub account.
3. Select the GitHub account or organisation for which you'd like to install the Hashnode Docs App.
4. Select the repository you'd like to use as your source of publishing the guides. Click on "Install & Authorize" button when you're done so.
5. After a successful installation, you'll be redirected to your GitHub Sync dashboard page, where an initial deployment of the repository will be done, publishing all guides you have in the repository.
6. Subsequent changes made on the GitHub repository will be reflected on the dashboard, allowing you to keep track of the status of the deployment.
Now you are setup. Go to your repository and make any changes to your project. Once we detect a commit to your main branch, we will automatically deploy your changes and publish them.
Hashnode CLI
Hashnode CLI is a command-line interface tool that allows you to manage your docs directly from your terminal. It provides commands to verify your local changes.
Note: The Hashnode CLI is currently under active development. Some features may be incomplete or subject to change. We appreciate your patience and feedback as we work to improve the tool.
- Install Hashnode CLI
npm install -g @hashnode/cli
2. Run the verify command to check if your local changes doesn’t have errors.
hashnode docs verify
-
The first prompt would ask for your Personal Access Token to login.
-
In the next step the CLI will ask for your project ID on Hashnode. You can find it in the Docs Dashboard. These two steps will only be needed once when you run the CLI in a new repository for the first time.
You can verify your project's id in thehashnode.ts
file afterwards.
-
The
verify
command will inform you about any errors, such as duplicate slugs or other errors, that will prevent a successful deployment on Hashnode.