This guide covers setting up a Quartz repository on Codeberg, configuring Codeberg Pages for automatic deployment, and connecting Quartz Syncer.
Codeberg is a free, community-driven Git hosting service powered by Gitea.
Create a Quartz Repository
Option 1: Migrate from GitHub (Recommended)
- Log in to your Codeberg account.
- Click the + button in the top right and select New Migration.
- Select GitHub as the source.
- Enter the Quartz repository URL:
https://github.com/jackyzha0/quartz - Set your Repository name (e.g.,
quartz). - Click Migrate Repository.
Option 2: Create Empty and Push
-
Create a new repository on Codeberg.
-
Clone Quartz locally:
git clone https://github.com/jackyzha0/quartz.git cd quartz -
Change the remote and push:
git remote set-url origin https://codeberg.org/<username>/quartz.git git push -u origin v4
Configure Codeberg Pages
Codeberg Pages uses a special branch called pages or a separate repository named pages to serve static content. For Quartz, we recommend using Codeberg CI (Woodpecker) to build and deploy.
Option 1: Using Codeberg CI (Woodpecker)
Create a new file .woodpecker.yml in the root of your repository:
steps:
build:
image: node:22
commands:
- npm ci
- npx quartz build
when:
branch: v4
deploy:
image: alpine
secrets: [mail]
commands:
- apk add --no-cache git openssh-client
- git config --global user.email "$MAIL"
- git config --global user.name "Woodpecker CI"
- cd public
- git init
- git add -A
- git commit -m "Deploy to Codeberg Pages"
- git push -f https://$CI_REPO_OWNER:$CI_FORGE_TOKEN@codeberg.org/$CI_REPO_OWNER/pages.git HEAD:main
when:
branch: v4Pages Repository
This workflow pushes the built site to a separate
pagesrepository. Create a repository namedpageson Codeberg first.
Option 2: Manual Deployment
If you prefer not to use CI, you can manually build and deploy:
- Build Quartz locally:
npx quartz build - Create a repository named
pageson Codeberg - Push the contents of the
publicfolder to thepagesrepository
Enable Codeberg Pages
- Create a repository named
pages(or<username>.codeberg.pagefor a custom domain). - Your site will be available at
<username>.codeberg.page.
Project Pages
For project-specific pages, create a
.domainsfile in your pages repository containing your desired subdomain.
Generate an Access Token
- Log in to your Codeberg account.
- Go to Settings > Applications.
- Under Manage Access Tokens, click Generate New Token.
- Enter a Token Name (e.g.,
Quartz Syncer). - Select the repository scope (or leave default for all permissions).
- Click Generate Token.
- Copy the generated token immediately.
Token Security
The token is only shown once. Store it securely.
Configure Quartz Syncer
- Open Obsidian and go to Settings > Community Plugins > Quartz Syncer.
- In the Git settings tab:
- Remote URL:
https://codeberg.org/<username>/<repository>.git - Branch:
v4(or your Quartz branch) - Provider: Gitea / Codeberg
- Authentication Type: Username & Token/Password
- Username: Your Codeberg username
- Access Token: The token you generated
- Remote URL:
A green checkmark indicates a successful connection.
Custom Domain (Optional)
-
Create a file named
.domainsin your pages repository. -
Add your domain(s), one per line:
docs.example.com -
Configure your DNS:
- Subdomain: Create a
CNAMErecord pointing to<username>.codeberg.page - Apex domain: Create a
CNAMErecord pointing to<username>.codeberg.page(if your DNS provider supports CNAME flattening) or use a redirect service.
- Subdomain: Create a
HTTPS
Codeberg Pages automatically provisions SSL certificates for custom domains.