202602102209 - digital-garden-public-site-setup
Main Topic
Q: How do I publish selected Obsidian notes as a public digital garden while keeping my vault private?
A reliable architecture is to keep your Obsidian vault repo private, and publish only selected notes to a separate digital garden site repository. The site repo is what Vercel deploys. In practice, the Obsidian Digital Garden plugin is designed for this exact workflow.
The core idea:
- Vault repo stays private and remains your source of truth.
- Site repo is a separate repo created from the digital garden template, which receives published notes via the plugin.
- Vercel is connected to the site repo and deploys on each push to the production branch.
🌲 Branching Questions
Q: What is the recommended architecture, and why?
Use the Obsidian Digital Garden plugin to publish notes to a dedicated site repository created from the oleeskild/digitalgarden template. This keeps the vault private while the site is built and deployed from the site repo.
Reasons this is a good default:
- Clear separation of concerns: private knowledge capture vs public publishing.
- Lower risk: only notes explicitly published are pushed to the site repo.
- Operational simplicity: Vercel deploys automatically from the repo.
Q: How do I set it up end-to-end?
- Create the site repository
- Start from the digital garden template and create your own copy (the template repo offers a Deploy to Vercel flow that creates a GitHub repo and a Vercel project).
- Keep the site repository separate from your vault repository.
- Configure GitHub credentials for the plugin
- Create a fine-grained GitHub personal access token scoped only to the site repository.
- Minimum permissions are typically Contents: read and write. Avoid granting broader scopes.
- Configure the Obsidian Digital Garden plugin
- Set your GitHub username.
- Set the site repository name.
- Set the branch (commonly main).
- Paste the fine-grained token.
- Configure Vercel
- Ensure the production branch is the same branch the plugin pushes to (commonly main).
- Each push to the production branch triggers a production deploy.
- Custom domain (optional)
- Add your domain in Vercel project settings.
- Update DNS records at your registrar as Vercel instructs.
Q: Where should configuration live in the site repo for easy management?
The digital garden template supports a customization entry point in src/helpers/userSetup.js. To keep configuration centralized and easy to update:
- Create src/helpers/userConfig.js with your settings.
- Import userConfig from userSetup.js.
Keep styling overrides isolated:
- Put CSS overrides in src/site/styles/user/ so template updates are less painful.
Q: How do I keep the private vault safe while the site is public?
- Publish only explicitly marked notes and review changes before publishing.
- Treat the site repo as public-facing, even if the repo itself is private.
- Do not put secrets in notes or frontmatter.
- Keep the GitHub token least-privilege and scoped only to the site repo; rotate it if you suspect exposure.
- Enable 2FA on GitHub and Vercel.
Q: What is the publish workflow, and when does Vercel deploy?
- In a note you want public, set frontmatter dg-publish: true.
- In Obsidian, run the plugin’s publish command (single note or batch).
- The plugin commits and pushes changes to the site repo.
- Vercel automatically deploys on every push to the production branch.
Q: What information do I need to have ready?
- Your GitHub username.
- The name of the site repository.
- A fine-grained GitHub token scoped to the site repository.
- Optional: your custom domain.
References
- Obsidian Digital Garden repository: https://github.com/oleeskild/obsidian-digital-garden
- Digital Garden docs: https://dg-docs.ole.dev
- Vercel Git integration docs: https://vercel.com/docs/deployments/git
- Vercel custom domains: https://vercel.com/docs/domains