This guide covers setting up a Quartz repository on Bitbucket, configuring deployment, and connecting Quartz Syncer.
Bitbucket Hosting Options
Bitbucket does not have a built-in static site hosting service like GitHub Pages. This guide covers deploying to external hosting services using Bitbucket Pipelines.
Create a Quartz Repository
Option 1: Import from GitHub
- Log in to Bitbucket and go to your workspace.
- Click Create > Repository.
- Click Import repository in the top right.
- Enter the Quartz URL:
https://github.com/jackyzha0/quartz.git - Set your Repository name (e.g.,
quartz). - Click Import repository.
Option 2: Create and Push Manually
-
Create a new repository on Bitbucket.
-
Clone Quartz locally:
git clone https://github.com/jackyzha0/quartz.git cd quartz -
Change the remote and push:
git remote set-url origin https://bitbucket.org/<workspace>/<repository>.git git push -u origin v4
Configure Deployment
Since Bitbucket doesn’t have built-in static hosting, you’ll need to deploy to an external service. Below are configurations for popular hosting options.
Option 1: Deploy to Netlify
Create a file bitbucket-pipelines.yml in your repository root:
image: node:22
pipelines:
branches:
v4:
- step:
name: Build and Deploy to Netlify
caches:
- node
script:
- npm ci
- npx quartz build
- npm install -g netlify-cli
- netlify deploy --prod --dir=public --site=$NETLIFY_SITE_ID --auth=$NETLIFY_AUTH_TOKENAdd these repository variables in Repository settings > Pipelines > Repository variables:
NETLIFY_SITE_ID: Your Netlify site IDNETLIFY_AUTH_TOKEN: Your Netlify personal access token
Option 2: Deploy to Cloudflare Pages
image: node:22
pipelines:
branches:
v4:
- step:
name: Build and Deploy to Cloudflare
caches:
- node
script:
- npm ci
- npx quartz build
- npm install -g wrangler
- wrangler pages deploy public --project-name=$CF_PROJECT_NAMEAdd these repository variables:
CLOUDFLARE_API_TOKEN: Your Cloudflare API tokenCLOUDFLARE_ACCOUNT_ID: Your Cloudflare account IDCF_PROJECT_NAME: Your Cloudflare Pages project name
Option 3: Deploy to Vercel
image: node:22
pipelines:
branches:
v4:
- step:
name: Build and Deploy to Vercel
caches:
- node
script:
- npm ci
- npx quartz build
- npm install -g vercel
- vercel deploy --prod --token=$VERCEL_TOKEN publicAdd this repository variable:
VERCEL_TOKEN: Your Vercel access token
Enable Bitbucket Pipelines
- Go to your repository on Bitbucket.
- Navigate to Repository settings > Pipelines > Settings.
- Enable Pipelines.
Generate an App Password
Bitbucket uses App Passwords for API authentication instead of Personal Access Tokens.
- Click your profile avatar in the bottom left and select Personal settings.
- Under Access management, click App passwords.
- Click Create app password.
- Enter a Label (e.g.,
Quartz Syncer). - Under Permissions, select:
- Repositories: Write (this includes Read)
- Click Create.
- Copy the generated password immediately.
Password Security
The app password 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://bitbucket.org/<workspace>/<repository>.git - Branch:
v4(or your Quartz branch) - Provider: Bitbucket
- Authentication Type: Username & Token/Password
- Username:
x-token-auth(when using an App Password) - Access Token: The app password you generated
- Remote URL:
A green checkmark indicates a successful connection.
Username Options
You can use either
x-token-author your Bitbucket username. Usingx-token-authis the standard method for App Passwords.
Bitbucket Server (Self-Hosted)
If you’re using Bitbucket Server (Data Center):
- Replace
bitbucket.orgwith your Bitbucket Server URL. - Generate an HTTP Access Token:
- Go to Profile > Manage account > HTTP access tokens
- Create a token with Repository write permission
- Use your Bitbucket Server username in the Username field.
Alternative: Direct Hosting Service Integration
Instead of using Bitbucket Pipelines, you can connect your hosting service directly to Bitbucket:
Netlify
- Log in to Netlify.
- Click Add new site > Import an existing project.
- Select Bitbucket and authorize.
- Select your Quartz repository.
- Configure build settings:
- Build command:
npx quartz build - Publish directory:
public
- Build command:
Cloudflare Pages
- Log in to Cloudflare Dashboard.
- Go to Workers & Pages > Create application > Pages.
- Connect to Git and select Bitbucket.
- Select your repository and configure:
- Build command:
npx quartz build - Build output directory:
public
- Build command:
Vercel
- Log in to Vercel.
- Click Add New > Project.
- Import from Bitbucket.
- Configure:
- Build Command:
npx quartz build - Output Directory:
public
- Build Command: