This website is built using Docusaurus, a modern static website generator.
npm i
npm start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
npm run build
This command generates static content into the build
directory and can be served using any static contents hosting service.
graph TD;
A[Root Directory]
A --> E[overview/]
E --> E1[getting-started.md]
A --> C[codelabs/]
C --> C1[codelabs.md]
C --> C2[Codelab Contents goes here]
C --> C3[intro.md]
C --> C4[next-steps.md]
A --> D[contributing/]
D --> D1["..."]
A --> B[changelog/]
B --> B1[changelog.md]
A --> F[showcase/]
F --> F1[showcase.md]
A --> G[static/]
G --> G1[kdocs/]
G --> H1[...]
This project uses two repositories with automated documentation integration:
Kotlin Repo: Source code with KDocs Docusaurus Repo: Documentation site that displays the generated API docs
┌─────────────────────┐ ┌──────────────────────┐
│ Kotlin Repository │ │ Docusaurus Repository│
│ │ │ │
│ ┌───────────────┐ │ │ ┌───────────────┐ │
│ │ Source Code │ │ │ │ Markdown │ │
│ └───────┬───────┘ │ │ │ Documentation│ │
│ │ │ │ └───────────────┘ │
│ ┌───────▼───────┐ │ │ │
│ │ Dokka Tool │ │ │ ┌───────────────┐ │
│ └───────┬───────┘ │ │ │ Static Dir │ │
│ │ │ │ │ ┌─────────┐ │ │
│ ┌───────▼───────┐ │ │ │ │ /api/ │◄─┼───┘
│ │ Generated │ │ │ │ └─────────┘ │ │
│ │ API Docs │──┼─────┼─►│ │ │
│ └───────────────┘ │ │ └───────────────┘ │
└─────────────────────┘ └──────────────────────┘
[Code Changes] → [Trigger Action] → [Build KDocs] → [Copy to Docusaurus] → [Deploy Site]
GitHub Actions Setup
- In Multipaz Repository => .github/workflows/trigger-docusaurus-update.yml
- In Multipaz Developer Website Repository => .github/workflows/docs.yml
To enable automatic documentation updates between repositories, you need to set up a Personal Access Token (PAT).
- Go to GitHub Settings: Navigate to https://github.com/settings/personal-access-tokens/new
- Select Token Type: Choose "Fine-grained personal access tokens"
- Configure Token Settings:
- Token name:
DOCS_REPO_ACCESS_TOKEN
- Description:
Token for automated documentation updates between multipaz and developer website repo
- Expiration:
366 days
(or your preferred duration)
- Token name:
- Set Repository Access:
- Resource Owner:
openwallet-foundation
- Repository access:
Selected repositories
- Select repository:
openwallet-foundation/multipaz-developer-website
- Resource Owner:
- Set Permissions:
- Content:
Read and write
- Metadata:
Read
- Content:
- Generate Token: Click "Generate token" and copy the token immediately (it won't be shown again)
- Go to Multipaz Repository: Navigate to https://github.com/openwallet-foundation/multipaz/settings/secrets/actions
- Add New Secret:
- Click "New repository secret"
- Name:
DOCS_REPO_ACCESS_TOKEN
- Secret: Paste the token you generated in Step 1
- Click "Add secret"
This setup allows the Trigger Docs Update workflow to automatically update the developer website whenever changes are made to the multipaz repository.
Docusaurus can run in two modes depending on your deployment setup:
For custom domains like developer.multipaz.org
:
- Enable GitHub Pages: In Docusaurus repo, go to Settings → Pages and enable GitHub Pages with GitHub Actions as source
- Set Custom Domain: Under Custom domain, enter:
developer.multipaz.org
- Save Changes: Click save to apply the custom domain
- Verify DNS: Optionally, verify that DNS settings (CNAME or A records) are set properly for
developer.multipaz.org
pointing to GitHub Pages - Set Environment Variable: Configure
WEBSITE_ENVIRONMENT
GitHub repository variable asPRODUCTION
For github.io pages like openwallet-foundation.github.io/multipaz-developer-website
:
- Enable GitHub Pages: In Docusaurus repo, go to Settings → Pages and enable GitHub Pages with GitHub Actions as source
- Set Environment Variable: Configure
WEBSITE_ENVIRONMENT
GitHub repository variable asDEVELOPMENT
- No Custom Domain: Leave the custom domain field empty
After configuration:
- Trigger the
Build and Deploy Docusaurus with KDocs
workflow - The
baseUrl
will automatically be set to:/
for custom domains (PRODUCTION mode)/{repository_name}
for github.io pages (DEVELOPMENT mode)
See GitHub's guide for more details: Configuring a custom domain for your GitHub Pages site