Step-by-Step Guide to Publishing Your Obsidian Vault with Quartz
This guide will walk you through the process of publishing your Obsidian Vault “General” online using Quartz.
Prerequisites:
- Windows 10 Laptop: You’ve already confirmed this.
- Node.js v20 or higher: You have v22.7.0, which is perfect.
- npm v9.3.1 or higher: While you have v10.8.2, it’s recommended to update to the latest npm version. Open your terminal (PowerShell or Command Prompt) and run:
npm install -g npm@latest - Obsidian Vault “General”: Located at
D:\ACC_ID\OneDrive\Desktop\ObsidianVaults\General, ready to be published.
Steps:
1. Clone the Quartz repository:
- Open your terminal and navigate to a directory where you want to store the Quartz project. You can use the
cdcommand for this. For example:cd D:\ACC_ID\OneDrive\Desktop\ - Clone the repository using Git:
git clone https://github.com/jackyzha0/quartz.git
2. Install dependencies:
- Navigate into the newly created
quartzdirectory:cd quartz - Install the required npm packages:
npm install
3. Create a new Quartz site:
- Run the following command to initialize a new Quartz site:
npx quartz create - This command will prompt you with a few questions:
- Project name: You can leave this as the default or choose a custom name.
- Content directory: You will need to specify the path to your Obsidian Vault “General”. Enter:
D:\ACC_ID\OneDrive\Desktop\ObsidianVaults\General - Do you want to add a template? Choose “No” for now.
4. Build and preview your site locally:
- Run the following command to build the site and start a local server:
npx quartz build --serve - Open your web browser and visit
http://localhost:8080/to see your published Obsidian Vault.
5. Configure Quartz (optional):
- If you want to customize the appearance or behavior of your site, you can edit the
quartz.config.tsfile in thequartzdirectory. Refer to the “Configuration” section in the documentation for available options.
6. Create a GitHub repository:
- Go to GitHub.com and create a new repository.
- Important: Do not initialize the repository with a README, license, or .gitignore file.
7. Connect your local Quartz project to the GitHub repository:
- Copy the repository URL from GitHub.
- In your terminal, navigate to the
quartzdirectory. - Run the following commands, replacing
REMOTE-URLwith your copied repository URL:git remote set-url origin REMOTE-URL git remote add upstream https://github.com/jackyzha0/quartz.git
8. Sync your content to GitHub:
- Run the following command to push your initial content to the repository:
npx quartz sync --no-pull - For future updates, you can simply run
npx quartz syncto push changes.
9. Choose a hosting provider and deploy:
- The documentation provides instructions for various hosting providers, including Cloudflare Pages, GitHub Pages, Vercel, Netlify, and GitLab Pages. Choose the one that suits your needs.
- Follow the specific instructions for your chosen provider in the “Hosting” section of the documentation.
10. Verify your published site:
- Once the deployment is complete, visit the URL provided by your hosting provider to verify that your Obsidian Vault is successfully published online.
Key Considerations:
- Private Pages: If you have notes in your Obsidian Vault that you don’t want to publish, you can use the
draft: truefrontmatter field in those notes or configureignorePatternsinquartz.config.ts. - Customization: Explore the Quartz documentation to learn more about customizing your site’s appearance, functionality, and adding plugins.
- Syncing: Regularly run
npx quartz syncto keep your online site updated with changes made in your Obsidian Vault.
This detailed guide should help you successfully publish your Obsidian Vault “General” with Quartz. Remember to consult the official Quartz documentation for further details and troubleshooting. Good luck!