This repository holds KIRA's documentation. It leverages Nocusaurus to extract content from KIRA's Notion workspace using the Notion API and transform it into sructured Markdown files. These files are then processed with Docusaurus v3 to generate static HTML files deployed via gutHub page.
Static site deployment branch: docs.kira.network
Build with us! Submit your project idea here, and get promoted.
- Clone Repository: Clone the repository to your local machine.
git clone https://github.com/KiraCore/docs.kira.network.git
- Install yarn and node
sudo apt update
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
# Verify installations
node -v
npm -v
yarn -v
- Install dependencies:
yarn install # Install dependencies
-
Set Required Environment Variables: Set
GIT_PASS
andGIT_USER
for GitHub deployment, andDOCU_NOTION_SAMPLE_ROOT_PAGE
andDOCU_NOTION_INTEGRATION_TOKEN
for Notion integration.- For GitHub Deployment:
export GIT_PASS=[***] export GIT_USER=[***]
- For Notion Integration:
export DOCU_NOTION_SAMPLE_ROOT_PAGE=[***] export DOCU_NOTION_INTEGRATION_TOKEN=[***]
Follow the Docusaurus deployment documentation and Notion's integration setup guide for more details.
- For GitHub Deployment:
- Pull: Update content on Notion and pull in
temp/
folder
yarn pull # Fetch content from Notion (needs $DOCU_NOTION_SAMPLE_ROOT_PAGE and $DOCU_NOTION_INTEGRATION_TOKEN)
- Test: Sync the
tabs/
folder, move pages from "srcpage" tabs intosrc/page/
folder if needed, then launch on localhost for testing
rsync --checksum
(yarn update
) syncstabs/
from the temporary folder, updating only changed files. It is used to preserveshowLastUpdateTime
in Docusaurus by avoiding the Nocusaurus pull process, which refreshes the entire output folder, falsely updating timestamps. However, renaming a page will not preserve history as it changes its file name and create a new one without git history.
yarn update # Push modifications from temp/ to tabs/
yarn srcpages # (Optional) This automatically move all custom pages from the tabs "srcpage" into the src/pages/ folder
yarn start # Start http://localhost:3000/ for testing
- Commit: Confirm tests, then commit and push
Committing and pushing updates made to
tabs
is necessary to maintain the Git history, essential for tracking each page'sshowLastUpdateTime
git status # (Optional) Lists pages that are modified + new pages that need to be added to commit
git add . # (Optional) Add all new created pages
git commit -a -m "commit message" # commit changes made to tabs/ etc...
git push
- Deploy: Build, serve if needed, and deploy
yarn build # Build Docusaurus static site
yarn serve # (Optional) Serve the build for additional testing before production deployment
yarn deploy # Deploy to GitHub Pages (needs $GIT_PASS and $GIT_USER)